vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

e2e-nightwatch error installing in an already Created Project #4975

Open adrianovieira opened 4 years ago

adrianovieira commented 4 years ago

Version

4.1.1

Reproduction link

https://gist.github.com/adrianovieira/0d044ed7f191c62eae739d19fa4c1cec

Environment info

Environment Info:

  System:
    OS: Linux 5.3 Fedora 31 (Workstation Edition) 31 (Workstation Edition)
    CPU: (8) x64 Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz
  Binaries:
    Node: 12.13.0 - ~/miniconda2/envs/Node.js-12.13/bin/node
    Yarn: Not Found
    npm: 6.13.4 - ~/miniconda2/envs/Node.js-12.13/bin/npm
  Browsers:
    Chrome: 79.0.3945.88
    Firefox: 71.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app:  4.1.1 
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  4.1.1 
    @vue/cli-plugin-babel: ^4.1.0 => 4.1.1 
    @vue/cli-plugin-e2e-nightwatch: ^4.1.1 => 4.1.1 
    @vue/cli-plugin-eslint: ^4.1.0 => 4.1.1 
    @vue/cli-plugin-router:  4.1.1 
    @vue/cli-plugin-vuex:  4.1.1 
    @vue/cli-service: ^4.1.0 => 4.1.1 
    @vue/cli-shared-utils:  4.1.1 
    @vue/component-compiler-utils:  3.1.0 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.3 
    vue: ^2.6.10 => 2.6.11 
    vue-eslint-parser:  5.0.0 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.8.3 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.11 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 4.1.1

Steps to reproduce

  1. vue create --default hello-world
  2. cd hello-world
  3. vue add e2e-nightwatch

What is expected?

installation works properlly

What is actually happening?

⠋  Running completion hooks...error: Unexpected console statement (no-console) at tests/e2e/custom-commands/customExecute.js:32:7:
  30 |     function (result) {
  31 |       // The "result" object contains the result of what we have sent back from the browser window
> 32 |       console.log('custom execute result:', result.value)
     |       ^
  33 |     }
  34 |   )
  35 | 
LinusBorg commented 4 years ago

Interesting that this doesn't happen when installed during project creation.

We can likely solve this short-termn with an eslint comment disabling the no-console rule. Long-Termn we should likely seek a solution were the linting run doesn't break things here if it comes across somethin non-fixable.

As this happened during the completion hooks phase, the plugin should be usable iny ou project nonetheless, as it has been installed, template files have been generated etc.

undavide commented 4 years ago

No idea whether this is related or not, but I've a vue-cli based project where vue-cli-service serve is fine, but I get the very same Unexpected console statement error when vue-cli-service build – i.e. it doesn't like any console.log statement.

If I run vue-cli-service build a second time, it works properly. Slightly annoying but bearable.