Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcompiler-core esm build depends on non-esm depenency #2258
Comments
I executed |
Yes, that's the one. No esm build for babel/parser. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
3.0.0
Reproduction link
https://github.com/lmiller1990/vite-repro
Steps to reproduce
yarn install
yarn vite
go to localhost:3000
look in the console
Uncaught SyntaxError: import not found: parse compiler-core.esm-bundler.js:3:9
What is expected?
No error
What is actually happening?
Fails due to esm build depending on @babel/parser which does not ship an esm build
Not sure how common this use case is, we use this in VTU to compile slots passed in the mounting options as template strings, which is why I noticed it.
https://github.com/vuejs/vue-test-utils-next/blob/master/src/utils/compileSlots.ts
Not a common use case. Also not sure if this is something we can fix here; we need babel parser to have an esm build, or we compile the cjs build into esm and inline it to the compiler-core esm build? Happy to fix this, not sure what the best way to do this would be.