can't import Vue component built by vue-cli-service can't import Vue component built by vue-cli-service vue.js vue.js

can't import Vue component built by vue-cli-service


I was facing the same exact problem while using vue-cli to build and test my Vue component. Fortunately I was able to find the solution after reporting it as a bug to vue-cli issue tracker on GitHub. Turned out there was nothing wrong with the common.js file nor was it a bug.

Anyway... long story short, the existing project you are trying to import into is unable to resolve symlinks (because this is what happens when you use npm link). In order to solve your problem, you need to add the following into vue.config.js in the root folder of the project you are importing into:

// vue.config.jsmodule.exports = {    chainWebpack: config => config.resolve.set('symlinks', false)}

Hope this helps. For more info, check out these links:

My issue report in the vue-cli tracker
Webpack configuration: resolve.symlinks