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

compiler-core esm build depends on non-esm depenency #2258

Closed
lmiller1990 opened this issue Sep 28, 2020 · 2 comments
Closed

compiler-core esm build depends on non-esm depenency #2258

lmiller1990 opened this issue Sep 28, 2020 · 2 comments

Comments

@lmiller1990
Copy link
Member

lmiller1990 commented Sep 28, 2020

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.

@watonyweng
Copy link

I executed yarn dev and got information in the console Uncaught SyntaxError: The requested module '/@modules/@babel/parser/lib/index.js' does not provide an export named 'parse'

@lmiller1990
Copy link
Member Author

Yes, that's the one. No esm build for babel/parser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants