Subscribe on changes!

compiler-core esm build depends on non-esm depenency

avatar
Sep 28th 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.

avatar
Sep 29th 2020

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'

avatar
Sep 29th 2020

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