Rollup-plugin-vue: Cannot find module 'vue-template-compiler'

Created on 17 Nov 2018  路  5Comments  路  Source: vuejs/rollup-plugin-vue

Expected behavior

Create sound output

Actual behavior

Throwing error

I was trying out minimal example that i faced this :

[!] Error: Cannot find module 'vue-template-compiler'
Error: Cannot find module 'vue-template-compiler'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/hosein/Documents/testing pa...

Installing vue-template-compiler manually solved it.

Depenedecies:

"rollup": "^0.67.3",
"rollup-plugin-vue": "^4.3.2",

rollup config:

import vue from 'rollup-plugin-vue'

export default {
  input: './comp.vue',
  output: {
    format: 'esm',
    file: 'dist/MyComponent.js'
  },
  plugins: [
    vue()
  ]
}

Most helpful comment

This is not a bug peerDependencies should be installed by user.
But this should have been said in docs.

All 5 comments

npm install vue-template-compiler --save-dev

I guess everyone knows that it would work that way, this was opened cause i wonder why it's not installed by default.

vue-template-compiler is listed in peerDependencies so it is expected. You should had seen a warning when you install rollup-plugin-vue without vue-template-compiler.

it is bug @hosein2398

This is not a bug peerDependencies should be installed by user.
But this should have been said in docs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rayrutjes picture rayrutjes  路  7Comments

cloudever picture cloudever  路  3Comments

Infeligo picture Infeligo  路  4Comments

LeCoupa picture LeCoupa  路  7Comments

Zekfad picture Zekfad  路  6Comments