Skip to content
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

@vue/cli-plugin-eslint 4.0.0-rc.3 | TypeError: Cannot read property 'version' of undefined #4569

Closed
tomlla opened this issue Sep 12, 2019 · 10 comments
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@tomlla
Copy link

tomlla commented Sep 12, 2019

Version

4.0.0-rc.3

Environment info

$ uname -a
Linux 6eecff0756dc 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 Linux

$ node --version
v10.16.3

$ npm version
{ test: '0.1.0',
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  modules: '64',
  napi: '4',
  nghttp2: '1.39.2',
  node: '10.16.3',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.28.0',
  v8: '6.8.275.32-node.54',
  zlib: '1.2.11' }

package.json

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "test:unit": "vue-cli-service test:unit",
    "test:e2e": "vue-cli-service test:e2e"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "lodash-es": "^4.17.15",
    "vue": "^2.6.10",
    "vue-router": "^3.1.2",
    "vuetify": "^1.5.5",
    "vuex": "^3.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.5.5",
    "@mdi/font": "^3.6.95",
    "@vue/cli": "4.0.0-rc.3",
    "@vue/cli-plugin-babel": "4.0.0-rc.3",
    "@vue/cli-plugin-eslint": "4.0.0-rc.3",
    "@vue/cli-plugin-unit-jest": "4.0.0-rc.3",
    "@vue/cli-service": "4.0.0-rc.3",
    "@vue/eslint-config-prettier": "^3.0.5",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-jest": "^ 24.8.0",
    "html-webpack-harddisk-plugin": "^0.2.0",
    "normalize.css": "^8.0.1",
    "pug": "^2.0.4",
    "pug-plain-loader": "^1.0.0",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "vue-template-compiler": "^2.6.10",
    "vuetify-loader": "^1.0.5",
    "webpack-manifest-plugin": "^2.0.4"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ],
  "optionalDependencies": {
    "@vue/cli-plugin-e2e-cypress": "4.0.0-rc.3"
  }
}

babel.config.js

module.exports = {
  presets: [
    "@vue/app",
  ],
};

Steps to reproduce

$ npm run serve


> test@0.1.0 serve /test
> vue-cli-service serve

 ERROR  TypeError: Cannot read property 'version' of undefined
TypeError: Cannot read property 'version' of undefined
    at module.exports (/test/node_modules/@vue/cli-plugin-eslint/index.js:18:27)
    at plugins.forEach (/test/node_modules/@vue/cli-service/lib/Service.js:83:7)
    at Array.forEach (<anonymous>)
    at Service.init (/test/node_modules/@vue/cli-service/lib/Service.js:81:18)
    at Service.run (/test/node_modules/@vue/cli-service/lib/Service.js:220:10)
    at Object.<anonymous> (/test/node_modules/@vue/cli-service/bin/vue-cli-service.js:37:9)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-12T11_26_06_785Z-debug.log

What is expected?

successfully running webpack dev server.

What is actually happening?

TypeError: Cannot read property 'version' of undefined

is happed in

module.exports (/test/node_modules/@vue/cli-plugin-eslint/index.js:18:27)
@tomlla tomlla changed the title @vue/cli-plugin-eslint" 4.0.0-rc.3 | TypeError: Cannot read property 'version' of undefined @vue/cli-plugin-eslint 4.0.0-rc.3 | TypeError: Cannot read property 'version' of undefined Sep 12, 2019
@LinusBorg LinusBorg added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Sep 12, 2019
@LinusBorg
Copy link
Member

Hi

Thanks for filing this issue! Could you please provide a small reproduction in a Github repository so we can debug this without trying to replicate this ourselves?

That would be very helpful, thanks!

@tomlla
Copy link
Author

tomlla commented Sep 12, 2019

@LinusBorg

Thank you for your quick response.
I created a repository to reproduce this issue's problem.

https://github.com/tomlla/vuejs-vue-cli-issues-4569

@sodatea
Copy link
Member

sodatea commented Sep 12, 2019

Did you just upgrade your dependencies directly from 3.0?
In v4 eslint is required as a dependency of the project itself.
So npm install --save-dev eslint@4 may fix the warning.

@sodatea
Copy link
Member

sodatea commented Sep 13, 2019

Note the eslint version should be 4 for the config you're currently using (@vue/eslint-config-prettier@3).
ESLint 5 & 6 are only supported if you update the config to the latest version, too.

tomlla added a commit to tomlla/vuejs-vue-cli-issues-4569 that referenced this issue Sep 13, 2019
@tomlla
Copy link
Author

tomlla commented Sep 13, 2019

@sodatea

Thank you for your suggestion.

Did you just upgrade your dependencies directly from 3.0?

Yes. I tried to upgrade my project that generated vue-cli v3.


Note the eslint version should be 4 for the config you're currently using (@vue/eslint-config-prettier@3).

Thankyou. I installed the eslint version 4 in add-eslint branch

I got another build error.

tomlla/vuejs-vue-cli-issues-4569#2

Anyway, I'll try to fix my build error.

Is there information about how to upgrade the existing vue-cli v3 base probject to vue-cli v4?

@sodatea
Copy link
Member

sodatea commented Sep 13, 2019

How about trying it in a real-world app? There's neither .eslintrc.js file nor eslintConfig field of package.json in the reproduction repo. But in a real-world-app that can't happen.

As for the migration guide, it is still work-in-progress: https://github.com/vuejs/vue-cli/pull/4552/files

@tomlla
Copy link
Author

tomlla commented Sep 13, 2019

I'm trying to upgrade a real-world app.
But I can't publish all of the source code because my job contract.
I'll add more files if possible. let me know necessary files if you noticed.

now I added .eslintrc.js

https://github.com/tomlla/vuejs-vue-cli-issues-4569/pull/2/files

@tomlla
Copy link
Author

tomlla commented Sep 13, 2019

https://github.com/vuejs/vue-cli/pull/4552/files

👍 👍 👍 👍

@vue-bot
Copy link

vue-bot commented Sep 23, 2019

Hello!
This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues requiring feedback after 20 days of inactivity. It’s been at least 10 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. (A maintainer can also add the label not stale to keep this issue open.)

Thanks for being a part of the Vue community! 💪💚️

@vue-bot
Copy link

vue-bot commented Oct 3, 2019

Hey again! 😸️

It’s been 20 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. 🤖 Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Vue community! 💚️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

No branches or pull requests

4 participants