Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'zone.js/dist/zone.js' after upgrade to zone.js 0.11.0 #445

Closed
splincode opened this issue Aug 19, 2020 · 9 comments
Closed

Comments

@splincode
Copy link

splincode commented Aug 19, 2020

πŸ› Bug Report

 FAIL  file-size.pipe.spec.ts
  ● Test suite failed to run

    Cannot find module 'zone.js/dist/zone.js' from '../../../../../node_modules/jest-preset-angular/build/setupJest.js'

    Require stack:
      /node_modules/jest-preset-angular/build/setupJest.js
      /node_modules/jest-preset-angular/index.js
      src/stubs/setupJest.ts

      at Resolver.resolveModule (../../../../../node_modules/jest-resolve/build/index.js:307:11)

To Reproduce

Steps to reproduce the behavior:

  • upgrade zone.js 0.11.0

envinfo

System:
    OS: MacOS

Npm packages:
    jest: last
    jest-preset-angular: last
    typescript: last
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 19, 2020

Related to angular/angular#38473 (comment)

@ocombe
Copy link

ocombe commented Aug 20, 2020

@ahnpnl there is still an issue after upgrading to 0.11.1: Cannot find module 'zone.js/dist/zone.js' from 'node_modules/jest-preset-angular/build/setupJest.js'

It should load zone.js/dist/zone, not zone.js/dist/zone.js, because they have changed the build setup.
Same for the proxy file.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 20, 2020

Thanks @ocombe !

There should be a PR to update the usage of zone.js too, which was mentioned in angular/angular#38473 (comment) .

cc @JiaLiPassion

@Benji1109
Copy link

Benji1109 commented Aug 20, 2020

I have the same problem what have mentioned @ocombe

@ahnpnl ahnpnl reopened this Aug 20, 2020
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 20, 2020

the workaround in the meanwhile is

  • manually copy the content of node_modules/jest-preset-angular/build/setupJest.js to a file in your project

  • adjust all the import for zone.js

  • import that file into your setup jest file

@ahnpnl ahnpnl added πŸ› Bug Confirmed Bug is confirmed workaround1: obvious and removed Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Aug 20, 2020
@JiaLiPassion
Copy link
Contributor

Sorry for the inconveniences, now 0.11.1 is available, I will create a PR to update.

@ahnpnl ahnpnl added this to the 8.3.0 milestone Aug 20, 2020
@splincode
Copy link
Author

splincode commented Aug 20, 2020

@splincode
Copy link
Author

@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 23, 2020

Close via #448

@ahnpnl ahnpnl closed this as completed Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants