[email protected] can't import vue-loader

Created on 1 Jun 2018  路  8Comments  路  Source: standard-things/esm

Minimal error reproduce

https://github.com/silveryiris/esm-vue-loader-import-error

Test command

npm run start
or
node -r esm index.js

Error message

TypeError: Cannot read property 'value' of undefined

Summary

It was ok with [email protected] but failed with [email protected].
Not sure where the problem is :(

bug needs tests

Most helpful comment

v3.0.43 is released :tada:

All 8 comments

I can confirm, same issue with:

npm i babel-minify-webpack-plugin

// index.js
import BabelMinifyPlugin from 'babel-minify-webpack-plugin'
node -r esm index.js

On it.

I just trace back error source with
node_modules\@vue\component-compiler-utils\dist\parse.js
At line no.5 :

const compiler = require('vue-template-compiler');

This line Is failed at the script , hope it can save some debug time.

Thanks @silveryiris and @dnalborczyk!

I have some test debt to pay. I'm hoping if things settle a bit I can spend a few days just catching up on tests to help prevent regressions like this.

take your time, man. just make sure you don't burn out! :wink:

v3.0.43 is released :tada:

needless to say: fixed!! :smiley:

Splitting out cjsNamespace and esmNamespace properties into mutable variants allows me to provide .mjs files with immutable namespaces and others, that opt-in to mutable namespaces, the mutable variants without contaminating .mjs files. Mutable namespaces are handy for spys/stubs/mocks.

Was this page helpful?
0 / 5 - 0 ratings