-
Notifications
You must be signed in to change notification settings - Fork 309
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]: Must use import to load ES Module #2124
Comments
Relates to #2016 |
That file tries to be commonjs but it also uses import type. I’m not sure should it be written as commonjs or as esm. We should also check what tsconfig says about it. In current state it can cause problems |
@CSchulz I am having the same problem, My architecture is a monorepo one, and I used more or less the same configuration as the one at examples/monorepo and I run in the same error as the one here but I am using fesm2022. Did you find a workaround for this problem |
I am using patch-package or similar system to patch the condition in the file f.e. if you are using Angular 15+ there is ivy only, so you can just return true.
|
Version
13.1.1
Steps to reproduce
npm i
npm run test-esm
Expected behavior
Snapshot testing should work.
Actual behavior
Snapshot testing isn't working properly.
It seems that ng-snapshot.ts file is using the old require style resulting into the error:
jest-preset-angular/src/serializers/ng-snapshot.ts
Lines 42 to 51 in 2437b4a
Removing it from the ivyEnabled function in the ng-snapshot.js works.
Must use import to load ES Module: C:\Users\Ich\Daten\huk\web-lib-angular\node_modules@angular\core\fesm2020\core.mjs
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: