Rollup-plugin-vue: [!] Error: 'default' is not exported by node_modules\vue-runtime-helpers\dist\normalize-component.js

Created on 28 May 2019  Â·  3Comments  Â·  Source: vuejs/rollup-plugin-vue

Version

5.0.0

Reproduction link

https://github.com/vuejs/rollup-plugin-vue/tree/master/cookbook/minimal

Steps to reproduce

download https://github.com/vuejs/rollup-plugin-vue/tree/master/cookbook/minimal
npm i
npm i vue-template-compiler
npm run build

What is expected?

no error

What is actually happening?

src/MyComponent.vue → dist/MyComponent.js...
[!] Error: 'default' is not exported by node_modules\vue-runtime-helpers\dist\normalize-component.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
src\MyComponent.vue (23:9)
Error: 'default' is not exported by node_modules\vue-runtime-helpers\dist\normalize-component.js
    at error (D:\test\minimal\node_modules\rollup\dist\rollup.js:199:15)
    at Module.error (D:\test\minimal\node_modules\rollup\dist\rollup.js:17170:9)
    at handleMissingExport (D:\test\minimal\node_modules\rollup\dist\rollup.js:17495:21)
    at D:\test\minimal\node_modules\rollup\dist\rollup.js:20157:56
    at Array.reduce (<anonymous>)
    at Graph.handleMissingExport (D:\test\minimal\node_modules\rollup\dist\rollup.js:20156:27)
    at Module.traceVariable (D:\test\minimal\node_modules\rollup\dist\rollup.js:17276:28)
    at ModuleScope.findVariable (D:\test\minimal\node_modules\rollup\dist\rollup.js:13454:29)
    at Identifier$$1.bind (D:\test\minimal\node_modules\rollup\dist\rollup.js:14162:40)
    at CallExpression.NodeBase.bind (D:\test\minimal\node_modules\rollup\dist\rollup.js:13499:23)
    at CallExpression.bind (D:\test\minimal\node_modules\rollup\dist\rollup.js:14721:31)
    at ExportDefaultDeclaration$$1.NodeBase.bind (D:\test\minimal\node_modules\rollup\dist\rollup.js:13499:23)
    at ExportDefaultDeclaration$$1.bind (D:\test\minimal\node_modules\rollup\dist\rollup.js:14341:31)
    at Program.NodeBase.bind (D:\test\minimal\node_modules\rollup\dist\rollup.js:13495:31)
    at Module.bindReferences (D:\test\minimal\node_modules\rollup\dist\rollup.js:17124:18)
    at Graph.link (D:\test\minimal\node_modules\rollup\dist\rollup.js:20309:20)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `rollup -c --environment BUILD:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2019-05-28T07_42_24_141Z-debug.log

Most helpful comment

Installing and importing the rollup-plugin-commonjs and including the plugin in the rollup.config.js worked for me.

install commonjs package

npm install rollup-plugin-vue

add the following to your rollup.config.js
import commonjs from 'rollup-plugin-commonjs'
plugins: [ ... commonjs(), ... ]

All 3 comments

@josensanchez
This works, but the cookbook is not updated

Installing and importing the rollup-plugin-commonjs and including the plugin in the rollup.config.js worked for me.

install commonjs package

npm install rollup-plugin-vue

add the following to your rollup.config.js
import commonjs from 'rollup-plugin-commonjs'
plugins: [ ... commonjs(), ... ]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zekfad picture Zekfad  Â·  6Comments

lancetharper picture lancetharper  Â·  5Comments

LeCoupa picture LeCoupa  Â·  7Comments

fjc0k picture fjc0k  Â·  4Comments

rayrutjes picture rayrutjes  Â·  7Comments