vue-cli-plugin-nativescript-vue icon indicating copy to clipboard operation
vue-cli-plugin-nativescript-vue copied to clipboard

It works with Vue Cli 4.0?

Open acacha opened this issue 4 years ago • 8 comments

Same error than here: https://github.com/nativescript-vue/vue-cli-plugin-nativescript-vue/issues/2

ERROR Error: Cannot find module '@vue/cli-service/generator/template/src/router.js' from

But using vue cli 4.0.

acacha avatar Oct 22 '19 09:10 acacha

It looks like currently it isn't. Understandable considering vue cli 4 was released 5 days ago.

JenteVH avatar Oct 22 '19 14:10 JenteVH

Ok. For reference https://cli.vuejs.org/migrating-from-v3/

acacha avatar Oct 23 '19 18:10 acacha

https://cli.vuejs.org/migrating-from-v3/#the-global-vue-cli

acacha avatar Oct 23 '19 18:10 acacha

The default directory structure was changed:
src/store.js moved to src/store/index.js;
src/router.js renamed to src/router/index.js;

acacha avatar Oct 23 '19 18:10 acacha

Have the same error also. Error: Cannot find module '@vue/cli-service/generator/router/template/src/router.js'

How can we fix this?

yabuking84 avatar Nov 03 '19 09:11 yabuking84

This error it's also exist in Vue Cli 3

image

luiguild avatar Nov 04 '19 18:11 luiguild

Yeah, I got here because I was getting this error with Vue CLI 3.4.1. I heard talk of Vue CLI 4 fixing it, but here we are, I'm getting the same error on 4.*.

Package version 0.2.1.

paperscissors avatar Nov 07 '19 21:11 paperscissors

I can't add the plugin to Vue CLI projects either.

I have tried using both version 3 and (several variants of) version 4.

Version 3.12.1:

$ npx @vue/cli@3 create test
$ npx @vue/cli@3 add vue-cli-plugin-nativescript-vue
✔  Successfully installed plugin: vue-cli-plugin-nativescript-vue

? Enter a unique application identifier: org.nativescript.application
? Use HTML5 history mode? (Default: hash mode) No
? Is this a brand new project? (Default: Yes) Yes
? Dual Native AND Web development experience or a Native only? (Default: Dual) 
Dual Native AND Web
? What type of template do you want to start with? (Default: Simple) Simple
adding to package.json
deleting from package.json
doing template rendering

🚀  Invoking generator for vue-cli-plugin-nativescript-vue...
 ERROR  Error: Cannot find module '@vue/cli-service/generator/router.js' from '/home/jonkri/test/node_modules/vue-cli-plugin-nativescript-vue/generator/templates/simple/src'
Error: Cannot find module '@vue/cli-service/generator/router.js' from '/home/jonkri/test/node_modules/vue-cli-plugin-nativescript-vue/generator/templates/simple/src'
    at Function.resolveSync [as sync] (/home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/node_modules/resolve/lib/sync.js:89:15)
    at renderFile (/home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/lib/GeneratorAPI.js:422:17)
    at /home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/lib/GeneratorAPI.js:254:27
    at Generator.resolveFiles (/home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/lib/Generator.js:209:13)
    at processTicksAndRejections (internal/process/task_queues.js:88:5)
    at async Generator.generate (/home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/lib/Generator.js:116:5)
    at async runGenerator (/home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/lib/invoke.js:133:3)
    at async invoke (/home/jonkri/.npm/_npx/27842/lib/node_modules/@vue/cli/lib/invoke.js:117:3)

The same error occurs on the latest version (4.3.1), 4.2 (4.2.3), 4.1 (4.1.2) and 4.0 (4.0.5).

Using version 4 produces a number of ESLint errors as well:

error: Unnecessary escape character: \/ (no-useless-escape) at webpack.config.js:214:25:
  212 |             },
  213 |             {
> 214 |                 test: /[\/|\\]app\.css$/,
      |                         ^
  215 |                 use: [
  216 |                     'nativescript-dev-webpack/style-hot-loader',
  217 |                     {


error: Unnecessary escape character: \/ (no-useless-escape) at webpack.config.js:224:25:
  222 |             },
  223 |             {
> 224 |                 test: /[\/|\\]app\.scss$/,
      |                         ^
  225 |                 use: [
  226 |                     'nativescript-dev-webpack/style-hot-loader',
  227 |                     {


error: Unnecessary escape character: \/ (no-useless-escape) at webpack.config.js:236:28:
  234 |             {
  235 |                 test: /\.css$/,
> 236 |                 exclude: /[\/|\\]app\.css$/,
      |                            ^
  237 |                 use: [
  238 |                     'nativescript-dev-webpack/style-hot-loader',
  239 |                     'nativescript-dev-webpack/apply-css-loader.js',


error: Unnecessary escape character: \/ (no-useless-escape) at webpack.config.js:245:28:
  243 |             {
  244 |                 test: /\.scss$/,
> 245 |                 exclude: /[\/|\\]app\.scss$/,
      |                            ^
  246 |                 use: [
  247 |                     'nativescript-dev-webpack/style-hot-loader',
  248 |                     'nativescript-dev-webpack/apply-css-loader.js',


5 errors found.

The default options were chosen when queried by the create and add commands.

jonkri avatar May 16 '20 13:05 jonkri