primus / eventemitter3

EventEmitter3 - Because there's also a number 2. And we're faster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

chua1989 opened this issue · comments

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

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

@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

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.

I'm closing this as answered.