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

Native Federation - Unexpected Token #299

Open
eric-horodyski opened this issue Mar 9, 2023 · 1 comment
Open

Native Federation - Unexpected Token #299

eric-horodyski opened this issue Mar 9, 2023 · 1 comment

Comments

@eric-horodyski
Copy link
Contributor

Apologies for writing this issue in the repo for @angular-architects/module-federation-plugin, but this is where the source code for createEsBuildAdapter lives.

I'm attempting to use @module-federation/vite with MFEs that use @emotion/styled and am running into an issue after configuring the federation plugin. When I run npm run dev, I see the following sorts of errors repeated a few times:

 INFO  Preparing shared package @emotion/react/types/css-prop
 ERR!  Error bundling npm package @emotion/react/types/css-prop
 ERR!  Unexpected token (Note that you need plugins to import files that are not JavaScript)
 ERR!  For more information, run in verbose mode
 NOTE  If you don't need this package, skip it in your federation.config.js!
 INFO  Preparing shared package @emotion/react/macro
 ERR!  Error bundling npm package @emotion/react/macro
 ERR!  Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
 ERR!  For more information, run in verbose mode

So far, the first unexpected token error (the one not looking for a rollup plugin) is logged once, errors noting that I need @rollup/plugin-json is printed several times, with different package names.

If you pull down the following project here and run the following commands, you should be able to reproduce this error as well:

pnpm install
cd apps/summary
npm run dev

I saw another issue discussing how different plugins or loaders could be used, but I can't find any documentation pertaining to createEsBuildAdapter. Any hints on how to resolve this issue?

@eric-horodyski
Copy link
Contributor Author

Is there a better place to report this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant