Vue-loader: Getting error with latest vue-loader when compiling the build

Created on 11 Nov 2015  路  10Comments  路  Source: vuejs/vue-loader

ERROR in ./~/babel-loader?presets[]=es2015&plugins[]=transform-runtime!./~/vue-loader/lib/selector.js?type=script&index=0!./src/main.vue
Module build failed: ReferenceError: [BABEL] /home/thelinuxlich/aidax-client-graphs/node_modules/vue-loader/lib/selector.js?type=script&index=0!/home/thelinuxlich/aidax-client-graphs/src/main.vue: Unknown option: direct.presets

Most helpful comment

I have the same issue, I'm getting crazy :S

All 10 comments

I copy-pasted package.json and webpack.config.js contents from vue-loader-example, npm installed everything and now I get this error:

ERROR in ./~/babel-loader!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/chart/index.vue
Module not found: Error: Cannot resolve module 'babel-runtime/helpers/typeof' in /home/thelinuxlich/aidax-client-graphs/src/components/chart
 @ ./~/babel-loader!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/chart/index.vue 11:15-54

Hmm, I'm not getting this error doing a fresh install in vue-loader-example...

that's strange, I tried even removing node_modules and reinstalling, same result

What Node.js version are you using? I'm on 4.2.2

5

That might be it... babel 6 and Node 5 are both pretty unstable at the moment.

It might come from npm v3 which is default version in node5. (node4's default npm is v2)
I have a following WARNING in windows8.1 with node4.2.2 at npm i.

npm WARN peerDependencies The peer dependency babel-loader@^6.1.0 included from vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency babel-core@^6.1.2 included from vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency babel-plugin-transform-runtime@^6.1.2 included from vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency babel-preset-es2015@^6.1.2 included from vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency babel-runtime@^6.0.14 included from vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

So the typeof issue is indeed a babel bug and is fixed in latest babel packages.

For the peerDependencies, this is expected. With npm3 you simply need to install these peerDeps yourself.

I have the same issue, I'm getting crazy :S

Was this page helpful?
0 / 5 - 0 ratings