-
Notifications
You must be signed in to change notification settings - Fork 304
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
[Bug]: latest zone.js v0.13.2 is causing import error #2162
Comments
I have the same error, everything was working fine last night, and now all of my tests are broken https://github.com/teambit/envs-health-status/actions/runs/6153094762/job/16696392467 |
|
Looks like jest-preset-angular is using deep imports, instead of consuming the “public” entry-points IE jest-preset-angular/setup-jest.mjs Line 1 in 65a848a
Instead of something like; import 'zone.js/testing'; That being said, it’s a bit unclear how the I think as an interim for v0.13.x we could re-allow deep imports and remove them in v0.14.x. //cc @JiaLiPassion. |
`jest-preset-angular` imports `zone.js` using deep imports. This commit temporary allow this until the correct entry-points are used upstream. See: thymikee/jest-preset-angular#2162
`jest-preset-angular` imports `zone.js` using deep imports. This commit temporary allow this until the correct entry-points are used upstream. See: thymikee/jest-preset-angular#2162
Also occurs for new angular builders: "test": {
"builder": "@angular-builders/jest:run",
"options": {
"tsConfig": "tsconfig.spec.json",
"polyfills": ["zone.js", "zone.js/testing"]
}
} fixed by enforcing |
`jest-preset-angular` imports `zone.js` using deep imports. This commit temporary allow this until the correct entry-points are used upstream. See: thymikee/jest-preset-angular#2162 PR Close #51737
Deep imports will eventually no longer be allowed from The proper way to use zone testing is the following: import "zone.js";
import "zone.js/testing"; |
indeed the temp fix seems to work now, but I guess it's probably better to keep this issue open until a proper fix is implemented. Thanks for the info and quick turnaround about the Angular upstream :) |
Close thymikee#2162 From zone.js 0.13.2, the original `zone.js/bundles/zone-testing-bundle.js` is not easily import and will eventually removed from zone.js 0.14.0. The proper way to import zone.js and zone.js/testing is ``` import 'zone.js'; import 'zone.js/testing'; ``` So this PR use this way to import zone.js related bundles.
Close thymikee#2162 From zone.js 0.13.2, the original `zone.js/bundles/zone-testing-bundle.js` is not easily import and will eventually removed from zone.js 0.14.0. The proper way to import zone.js and zone.js/testing is ``` import 'zone.js'; import 'zone.js/testing'; ``` So this PR use this way to import zone.js related bundles.
Close #2162 From zone.js 0.13.2, the original `zone.js/bundles/zone-testing-bundle.js` is not easily import and will eventually removed from zone.js 0.14.0. The proper way to import zone.js and zone.js/testing is ``` import 'zone.js'; import 'zone.js/testing'; ``` So this PR use this way to import zone.js related bundles.
Since Angular v17 will require Zone.js version 0.14.x or later, this is still an issue? |
It's still an issue with the latest version of Angular (17.0.2), all of our tests are broken as well after upgrading. This is our following
And our
FAIL src/app/shared/components/features/search/components/search-companies/components/search-companies-by-id/pipe/search-companies-by-id-placeholder.pipe.spec.ts
|
updating to the latest version (13.1.4) seem to have solved the issue for me. |
Update package |
`jest-preset-angular` imports `zone.js` using deep imports. This commit temporary allow this until the correct entry-points are used upstream. See: thymikee/jest-preset-angular#2162 PR Close angular#51737
Hi @alexus85 which package was updated to 13.1.4? I am facing similar issue in my application when I update my angular to 16 and zone.js to 0.14.4. When I looked for reference, the only place where I see its been used is in the polyfills.ts `Test suite failed to run
|
@timothee-dhenain-zenika where you able to resolve your issue, if so what was the fix? Thanks |
Version
13.1.1
Steps to reproduce
zone.js
tov0.13.2
yarn install # yarn classic
yarn jest:coverage # or yarn jest:watch
Expected behavior
No error thrown
Actual behavior
I'm getting the following error (which can be seen under this GitHub Action PR failure)
Additional context
The error came from Renovate which runs once a week in my project, the dependency
zone.js
was updated less than a day ago and the import issue seem to come from this Angular PR and I'm not sure if the problem occurs in Angular or in Jest-Preset-Angular but I think it's latter and some imports might need to be updated as per the Angular PRNote: to verify that
zone.js
was really causing the issue, I have added it to Renovate skipped dependency in this commit and that allowed me to confirm thezone.js
was the root cause (though I'm not sure if the fix would be in Angular or in Jest-Preset-Angular)EDIT
A temp fix was implemented in Angular by adding back certain temp imports in this Angular PR 51737, however please note that this is a temp fix and is expected to be removed in
zone.js@0.14.0
, see comment belowEnvironment
The text was updated successfully, but these errors were encountered: