Compiler-sfc And [email protected]

Just an idea, but wouldn’t it make sense to add vue3 (aka [email protected]) to the requirements when creating a new F7 project with Vite as bundler, or include compiler-sfc into devDependencies?

On a system where vue 2 is installed, you’ll get an error:
“Cannot find module '@vue/compiler-sfc/package.json”

npm install @vue/compiler-sfc

or

npm install [email protected]

fixes it, but I think it would be nicer to have it in the dependencies (or at least a note in the installation)

But CLI adds to package.json [email protected] which has @vue/compiler-sfc as a dependency, or F7 CLI somehow creates project with vue 2 installed for you?

No - it seems it installed vue3 → I created a fresh sample app and everything looked fine, except of the error above :

{
  "cwd": "/Users/andy/testing_vite/test_pwa",
  "type": [
    "pwa"
  ],
  "name": "testpwa",
  "framework": "vue",
  "template": "tabs",
  "bundler": "vite",
  "cssPreProcessor": false,
  "theming": {
    "customColor": false,
    "color": "#007aff",
    "darkTheme": false,
    "iconFonts": true,
    "fillBars": false
  },
  "customBuild": false
}

running npm start brought the error above…

package.json had this:

“dependencies”: {
“dom7”: “^3.0.0”,
“framework7”: “^6.3.2”,
“framework7-icons”: “^5.0.3”,
“framework7-vue”: “^6.3.2”,
“material-icons”: “^1.2.1”,
“skeleton-elements”: “^3.5.0”,
“swiper”: “^6.8.4”,
“vue”: “^3.2.11”
},
“devDependencies”: {
@vitejs/plugin-vue”: “^1.6.0”,
“cpy-cli”: “^3.1.1”,
“cross-env”: “^7.0.3”,
“postcss-preset-env”: “^6.7.0”,
“vite”: “^2.5.3”,
“workbox-cli”: “^6.2.4”
}
}

After adding the command above, it worked:

 "devDependencies": {
    "@vitejs/plugin-vue": "^1.6.0",
    "@vue/compiler-sfc": "^3.2.11",
    "cpy-cli": "^3.1.1",
    "cross-env": "^7.0.3",
    "postcss-preset-env": "^6.7.0",
    "vite": "^2.5.3",
    "workbox-cli": "^6.2.4"
  }

As I said - this was on a clean machine (basically only a current version of NodeJS installed).
But if nobody else ever reported that, maybe it was something else…

Ok, will add to devdeps by default, just for the case

Added, in latest CLI 5.0.7

Great! Thanks!
That will fix it!