Skip to content

ESLint exception when using @vue/airbnb config on a file with alias import (@ as src) in Visual Studio Code #3570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JJBocanegra opened this issue Mar 4, 2019 · 4 comments

Comments

@JJBocanegra
Copy link

Version

3.4.1

Reproduction link

https://github.com/JJBocanegra/vue-cli-airbnb-eslint-issue

Environment info

System:
    OS: Linux 4.15 Linux Mint 19 (Tara)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  Binaries:
    Node: 11.1.0 - ~/.nvm/versions/node/v11.1.0/bin/node
    Yarn: 1.12.3 - /usr/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v11.1.0/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Firefox: 64.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.2 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.2 
    @vue/babel-preset-app:  3.4.1 
    @vue/babel-preset-jsx:  1.0.0-beta.2 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.2 
    @vue/babel-sugar-inject-h:  1.0.0-beta.2 
    @vue/babel-sugar-v-model:  1.0.0-beta.2 
    @vue/babel-sugar-v-on:  1.0.0-beta.2 
    @vue/cli-overlay:  3.4.1 
    @vue/cli-plugin-babel: ^3.4.0 => 3.4.1 
    @vue/cli-plugin-e2e-cypress: ^3.4.0 => 3.4.1 
    @vue/cli-plugin-eslint: ^3.4.0 => 3.4.1 
    @vue/cli-plugin-pwa: ^3.4.0 => 3.4.1 
    @vue/cli-plugin-unit-mocha: ^3.4.0 => 3.4.1 
    @vue/cli-service: ^3.4.0 => 3.4.1 
    @vue/cli-shared-utils:  3.4.1 
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-airbnb: ^4.0.0 => 4.0.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/test-utils: ^1.0.0-beta.20 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 
    vue: ^2.6.8 => 2.6.8 
    vue-burger-menu: ^2.0.1 => 2.0.1 
    vue-eslint-parser:  5.0.0 
    vue-hot-reload-api:  2.3.3 
    vue-js-modal: ^1.3.28 => 1.3.28 
    vue-loader:  15.7.0 
    vue-pagination-2:  1.6.2 
    vue-resource:  0.9.3 
    vue-router: ^3.0.1 => 3.0.2 
    vue-style-loader:  4.1.2 
    vue-tables-2: ^1.4.70 => 1.4.70 
    vue-template-compiler: ^2.6.8 => 2.6.8 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.0.1 => 3.1.0 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Open the project in Visual Studio Code
  2. Install all dependencies
  3. Open /src/views/Home.vue
  4. See in Output console with the ESLint section opened that it fails showing errors like this:
[Info  - 18:24:58] ESLint server stopped.
[Info  - 18:24:58] ESLint server running in node v10.2.0
[Info  - 18:24:58] ESLint server is running.
[Info  - 18:24:59] ESLint library loaded from: /home/jj/Documentos/Projects/leroy-empleados/node_modules/eslint/lib/api.js
/usr/share/code/code: symbol lookup error: /home/jj/Documentos/Projects/leroy-empleados/node_modules/fibers/bin/linux-x64-64-glibc/fibers.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
[Info  - 18:25:01] Connection to server got closed. Server will restart.
[Info  - 18:25:01] ESLint server stopped.

It happens five times before it stops retrying.

What is expected?

ESLint should work in files using imports with the alias @ as src

What is actually happening?

When there is an import with @ ESLint fails and stops.

If I use the same import with this path it works ./components/header/TheHeader.vue.

If I use an incorrect path like ./components/header/TheHdea.vue it's the same as using the alias @


If in .eslintrc.js I remove the @vue/airbnb in extends, it works perfectly.

@michaelhays
Copy link

Having the same issue. This has only started happening for me with newer versions of vue-cli, once it started including fibers as a devDependency.

@haoqunjiang
Copy link
Member

The fibers might not support Node v11 considering it is not an LTS version. Try Node v10?
Also this dependency can be safely removed from package.json, it is included only for performance boost.

@JJBocanegra
Copy link
Author

@sodatea I tried with Node v10.13.0 and the error persist. When fiber is uninstalled it works correctly.

@michaelhays
Copy link

Same feedback as @JJBocanegra. Error persists with Node v10.15.3, but lint on save works correctly after removing fibers from package.json and reinstalling.

Thanks for the workaround @sodatea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants