Skip to content

Requested module does not provide export named 'default' in vite #261

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

Closed
chua1989 opened this issue Jul 7, 2023 · 5 comments
Closed

Requested module does not provide export named 'default' in vite #261

chua1989 opened this issue Jul 7, 2023 · 5 comments

Comments

@chua1989
Copy link

chua1989 commented Jul 7, 2023

in vite development server , when node_modules contains uncompiled source code,got error

index.mjs?v=73fd6c6e:1 Uncaught SyntaxError: The requested module '/node_modules/eventemitter3/index.js?v=73fd6c6e' does not provide an export named 'default' (at index.mjs?v=73fd6c6e:1:8)

image

@lpinca
Copy link
Member

lpinca commented Jul 9, 2023

This is not an eventemitter3 issue. In the browser you need to use the module under the dist folder (eventemitter3.esm.js).

@chua1989
Copy link
Author

@lpinca Thank you, now I know how to solve this problem, but I feel that the path of exports should be replaced by the files in dist
image

@lpinca
Copy link
Member

lpinca commented Jul 10, 2023

but I feel that the path of exports should be replaced by the files in dist.

No, those are for Node.js and for environments that read package.json.

@lpinca
Copy link
Member

lpinca commented Jul 14, 2023

I'm closing this as answered.

@lpinca lpinca closed this as completed Jul 14, 2023
thewtex added a commit to thewtex/eventemitter3 that referenced this issue Aug 27, 2024
We need the built ESM module for the browser for bundlers like vite.

This addresses errors like issue primus#261:

> index.mjs?v=73fd6c6e:1 Uncaught SyntaxError: The requested module '/node_modules/eventemitter3/index.js?v=73fd6c6e' does not provide an export named 'default' (at index.mjs?v=73fd6c6e:1:8)
@sebbean
Copy link

sebbean commented Nov 26, 2024

i'm having this issue with electron vite

loading the obs-websocket-js package

image

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

3 participants