-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Error: Module "module" has been externalized for browser compatibility #9134
Comments
I am having this issue in my app since upgrading to Vite 3. The issue is coming from a library I'm using called I have a reproduction case here: https://stackblitz.com/edit/sveltejs-kit-template-default-azwtze?file=src%2Froutes%2Findex.svelte&terminal=dev To see the error, run
Interestingly, it works just fine in "prod" mode. If you run |
Hey @manucorporat, sorry for the regression. Would it be possible for you to PR Qwik CI or a part of it to https://github.com/vitejs/vite-ecosystem-ci? We can then detect these issues before releasing the next versions. A file in The issue appears in Qwik because you are setting |
@manucorporat this should be fixed in [email protected] |
@patak-dev unfortunately similar bugs are still there:
|
@sgnilreutr please create a new bug report with a reproduction, thanks! |
I'm getting similar error in browser while using y2be-player : Uncaught (in promise) Error: Module "events" has been externalized for browser compatibility. Cannot access "events.EventEmitter" in client code.
get events:9
<anonymous> y2be-player.js:45
events:9:12
lazyLoadYouTube https://website.test:5173/resources/js/app/index.js?t=1658337747784:100
AsyncFunctionThrow self-hosted:672
(Async: async)
onDocumentReady https://website.test:5173/resources/js/app/index.js?t=1658337747784:74
init https://website.test:5173/resources/js/app/index.js?t=1658337747784:52
App https://website.test:5173/resources/js/app/index.js?t=1658337747784:41
newApp https://website.test:5173/resources/js/app/index.js?t=1658337747784:134
<anonymous> https://website.test:5173/resources/js/pages/blog_post.js:6
InnerModuleEvaluation self-hosted:2361
evaluation self-hosted:2322 It seems to be related to the Class extending the EventEmitter |
I'm getting the same issue using Intertia + Laravel + Laravel vite:
|
@jimblue @sebsobseb please create a separate issue with a minimal reproduction. Thanks! |
@patak-dev there is a seperate issue #9238 |
That issue is closed, if you think that the comment from @sapphi-red isn't right please comment there. |
Describe the bug
At Qwik, we use Vite. When updating to 3.0.0, we found out that the app always crashes in the browser, because a SSR module leaks and it's imported through a ESM import in the browser code.
Internally QwikVite plugin uses ssrLoadModule(). seems like it's caching the transform needed for SSR and making it accessible from the client, when hitting the URL.
even manually setting
transformRequest(url, {ssr: false])
returns a request that in SSR only.This was not a problem in 2.9.9
Reproduction
https://stackblitz.com/edit/nextjs-opbbv2?file=README.md,src%2Froutes%2Findex.tsx,vite.config.ts
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: