2

I did upgrade my app from Angular 12.x to version 13.x

Build and Serve etc. work fine. But when I try to execute e2e-test I face following error:

E/launcher - Error: /Users/userName/PROJECT_NAME/node_modules/read-mail/
fesm2015/read-mail.mjs:1

import * as i0 from '@angular/core';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (/Users/userName/PROJECT_NAME/node_modules/coffeescript/
lib/coffee-script/register.js:45:36)

I have been searching and trying couple of fixes.. None of them did help. I also didn't a specific reference to such error on the GitHub Repo of the Angular community.

Any hint or idea what could cause such error? Is it an issue with Angular version 13.x?

k.vincent
  • 3,743
  • 8
  • 37
  • 74
  • I had a similar issue, including "esm support" + your e2e framework and transpiler (Coffeescript?) in your search terms may bring back relevant results. – stealththeninja Jan 15 '22 at 07:00

1 Answers1

-2

Add this flag into your tsconfig.json file, under compilerOptions

...
"allowSyntheticDefaultImports": true,
...

This solved that issue for me

Yordan Nikolov
  • 2,598
  • 13
  • 16