Subscribe on changes!

After upgrading to vue 3 when executing yarn electron:serve "Cannot find module '@vue/compiler-sfc/package.json' "

avatar
Sep 12th 2020

Version

3.0.0-rc.10

Reproduction link

https://github.com/raphael10-collab/ElectronVueTypeScriptScaffolding.git

Steps to reproduce

After upgrading to vue 3 :
yarn add vue@next

ElectronVueTypeScriptScaffolding$ yarn electron:serve

What is expected?

yarn electron:serve with no issues

What is actually happening?

yarn run v1.22.5 warning ../package.json: No license field $ vue-cli-service electron:serve INFO Starting development server... ERROR Error: Cannot find module '@vue/compiler-sfc/package.json' Require stack:

  • /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/config/base.js
  • /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/Service.js
  • /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/bin/vue-cli-service.js Error: Cannot find module '@vue/compiler-sfc/package.json' Require stack:
  • /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/config/base.js
  • /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/Service.js
  • /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/bin/vue-cli-service.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15) at Function.Module._load (internal/modules/cjs/loader.js:899:27) at Module.require (internal/modules/cjs/loader.js:1090:19) at require (internal/modules/cjs/helpers.js:75:18) at /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/config/base.js:115:30 at /home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/Service.js:236:40 at Array.forEach () at Service.resolveChainableWebpackConfig (/home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/Service.js:236:26) at Service.resolveWebpackConfig (/home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/Service.js:240:48) at PluginAPI.resolveWebpackConfig (/home/marco/webMatters/electronMatters/ElectronVueTypeScriptScaffolding/node_modules/@vue/cli-service/lib/PluginAPI.js:132:25) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When dowgrading vue to vue2 the problem disappears

avatar
Sep 13th 2020

You probably need to follow the migration guide https://v3.vuejs.org/guide/migration/introduction.html#overview


Remember to use the forum or the Discord chat to ask questions!

avatar
Sep 13th 2020

@posva Here: https://v3.vuejs.org/guide/migration/introduction.html#where-should-i-start-in-a-migration we read "Start by running the migration helper (still under development) on a current project. We've carefully minified and compressed a senior Vue dev into a simple command line interface. Whenever they recognize an obsolete feature, they'll let you know, offer suggestions, and provide links to more info." Since there is no link to migration helper, I searched in the net and found this: https://www.npmjs.com/package/vue3-migration-helper. But clicking on the homepage and on the repository links, I get "page not found" Actually the npm page says: "It's a placeholder package for now".

So, would you be so kind, @posva Eduardo,in pointing me to the right helping page? If you think the Vue Forum is more suitable, I already opened a question also there, but also in StackOverflow, and you can answer me there, pointing me to the right helping (functioning) page : https://forum.vuejs.org/t/after-upgrading-to-vue-3-cannot-find-module-vue-compiler-sfc-package-json/103424

avatar
Oct 27th 2020

I've posted some suggestions to your forum post.

I'm not aware of anywhere that this is currently documented. It may well be something that is handled by the migration helper once that's available.