manfredsteyer / mf-angular-13

3 stars 5 forks source link

Example works but 'SyntaxError: Cannot use 'import.meta' outside a module.' error is still present. #3

Open cnestor1 opened 2 years ago

cnestor1 commented 2 years ago

Thanks for a great API. We use @angular-architects/module-federation version 12 and web components without issue. However, migrating to Angular 13 MF is more painful.

I first tried with 14.0.0-beta.1 since 14.0.0-beta.5 doesn't work as stated by the previous issue. "@angular-architects/module-federation": "14.0.0-beta.1", "@angular-architects/module-federation-tools": "14.0.0-beta.1", "@angular/animations": "13.0.2",

and got this error: An unhandled exception occurred: Cannot find module 'ngx-build-plus/package.json' Require stack:

then ran yarn add ngx-build-plus

The Shell finally started and both Micro frontends (mfe1/react) are present! However, I still see this error in the log: styles.js:4534 Uncaught SyntaxError: Cannot use 'import.meta' outside a module

I then tried to use the latest release candidate: yarn add @angular-architects/module-federation@14.0.0-rc.1 yarn add @angular-architects/module-federation-tools@14.0.0-rc.1 selected: 14.0.0-beta.1.12

which results in the following package.json: "dependencies": { "@angular-architects/module-federation": "14.0.0-rc.1", "@angular-architects/module-federation-tools": "14.0.0-rc.1", "@angular/animations": "13.0.2", ...

When I start the shell, I get the following error: Cannot find module 'ajv-formats' If I try to install it I get the following error: npm i ajv-formats npm ERR! code ETARGET npm ERR! notarget No matching version found for @angular-architects/module-federation-runtime@14.0.0-rc.1. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

I then deleted package-lock, node_modules and reran a yarn install, and this time it works, albeit with this error: styles.js:4534 Uncaught SyntaxError: Cannot use 'import.meta' outside a module

19kills commented 2 years ago

We are seeing same styles.js:4534 Uncaught SyntaxError: Cannot use 'import.meta' outside a module with Angular 13.1.1