-
Notifications
You must be signed in to change notification settings - Fork 243
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
Uncaught SyntaxError: Cannot use import statement outside a module (at remoteEntry.js:1:1) #279
Comments
Try to add type="module" to the script. For example: <script type="module" src="/src/main.js"></script> |
Doesn't work for me. I am experiencing the same problem. The host in my case is a Webpack and the remote is using Vite. |
Didn't find a solution. Changed Vite to Webpack |
@js-lowes @ivankorobchuk123 did you find a solution? |
Sorry, no) |
Sorry, no) |
Unfortunately not, but I have tried vite plugin federation in awhile. Best of luck. |
This is pretty straightforward. Your remoteEntry.js from Vite is having import statements which are not allowed in browser unless the script tag has type="module" attribute. Just set the type module on the script tag and it will work fine. Something like |
I have a paths error.
Uncaught SyntaxError: Cannot use import statement outside a module (at remoteEntry.js:1:1)
The text was updated successfully, but these errors were encountered: