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

SyntaxError: The requested module './index.js' does not provide an export named 'default' #273

Open
pavanjoshi914 opened this issue Nov 14, 2024 · 2 comments

Comments

@pavanjoshi914
Copy link

pavanjoshi914 commented Nov 14, 2024

we have package1 which includes eventemitter3 and it follows esm there is another package package2 when I include package1 and when running in browser it throws the error. the package 2 is also an es module. is this can be resolved on your side.

i tried different rollup plugins but no success.

@sebbean
Copy link

sebbean commented Nov 26, 2024

samesies

@karlvr
Copy link

karlvr commented Jan 18, 2025

I had this issue as well, using vite and @rollup/plugin-commonjs. I had to disable @rollup/plugin-commonjs from working on eventemitter3 (5.0.1), and that resolved the issue that you've reported.

This is the plugin configuration in my vite config file:

commonjs({
	/* We want to fix local imports of files that are using commonjs style, but it interferes with external modules */
	exclude: [/node_modules/],
}),

I had similar problems with other external modules, so I excluded everything in node_modules.

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