How to fix "EventEmitter" is not exported by "__vite-browser-external". #15415
Replies: 3 comments 2 replies
-
The solution was https://www.npmjs.com/package/vite-plugin-node-polyfills |
Beta Was this translation helpful? Give feedback.
-
It is possible an unused import is causing this build failure. For example, if your emitter module is imported into a Remix route, but is not used in the loader, the build cannot properly analyze the import to determine if it's a client module or a server module. I believe it defaults to assuming it's a client module, which in this case results in a failure. It would be nice if the build could check for unused modules and fail with a clearer message at that step instead. |
Beta Was this translation helpful? Give feedback.
-
You might want to try installing this package — it resolved the issue for me: https://www.npmjs.com/package/events |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to build my Vue app, which shows me this error. I guess it has to do something with using the web3 package. Do you know how I can fix it?
It works when I commented out the codes of the EventEmitter part from web3-utils inside node_modules.
import { EventEmitter as EventEmitterAtNode } from 'events';
import { EventEmitter } from 'events';
This is not the best way to solve the issue so I want to know if there's another way.
Beta Was this translation helpful? Give feedback.
All reactions