-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
migrator for cli-plugin-eslint crashes during 'vue upgrade' #5357
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
Comments
What's the |
Actually, I had changed them all to exact values a while ago. I had previously realized that if we don't lock them down, then our build system can be building a production build with versions that we haven't tested with. from our package.json file "devDependencies": {
"@types/jest": "24.0.19",
"@types/lodash": "4.14.149",
"@types/webpack": "4.4.0",
"@typescript-eslint/eslint-plugin": "2.18.0",
"@typescript-eslint/parser": "2.18.0",
"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-e2e-cypress": "~4.3.0",
"@vue/cli-plugin-eslint": "~4.3.0",
"@vue/cli-plugin-pwa": "~4.2.0",
"@vue/cli-plugin-router": "~4.2.0",
"@vue/cli-plugin-typescript": "~4.2.0",
"@vue/cli-plugin-unit-jest": "~4.2.0",
"@vue/cli-plugin-vuex": "~4.2.0",
"@vue/cli-service": "~4.3.0",
"@vue/eslint-config-prettier": "6.0.0",
"@vue/eslint-config-typescript": "5.0.1",
"@vue/test-utils": "1.0.0-beta.32",
"babel-plugin-transform-decorators": "6.24.1",
"csstype": "2.6.9",
"eslint": "6.7.2",
"eslint-plugin-prettier": "3.1.1",
"eslint-plugin-vue": "6.1.2",
"node-sass": "4.12.0",
"prettier": "1.19.1",
"sass": "^1.19.0",
"sass-loader": "8.0.2",
"typescript": "~3.7.5",
"vue-cli-plugin-i18n": "~0.6.1",
"vue-cli-plugin-vuetify": "~2.0.5",
"vue-template-compiler": "2.6.11",
"vue-test-utils": "1.0.0-beta.11",
"vuetify-loader": "^1.3.0"
} I think the upgrade process inserted the ~. And all of this started because vuetify decided to stop building after upgrading cypress to 4.x so I reinstalled vuetify after the vue upgrade to get it working again, that's why it is using ^. |
Isn't that what lock files already protect you from ? |
@LinusBorg Ah, you are correct. That article I ready a year ago led me astray! I will go add back the range indicators into our package.json file. Thanks for pointing that out. |
We'll fix this nonerheless, but going back to versions with a caret should solve your issue |
@LinusBorg so am I able to just run vue upgrade again and it will do the right thing? |
I re-ran vue upgrade and there were packages that still needed to upgrade. I assume that is because the process crashed while migrating. I changed my package.json file to use "~" for all version numbers before I re-ran the command. I then realized that it didn't re-run eslint because it had already done the update. It just didn't do the migration. So I rolled back eslint and all the related packages and tried it again. This time it indicated that eslint was the only package that needed updating:
I did the install and it crashed during the migration again. It also didn't upgrade the package 'eslint'. I had version 6.7.2 installed and afterwards it was still on that version. It did update the plugin to 4.3.0. The crash was:
I am trying to debug it now. |
I was hoping I could put some console.log statements into the code but they disappeared so I am assuming that the files pointed to in the crash output above are overwritten during the process. but since I can't get some logs in there, I can't tell why Range's this.set is empty. Clearly the split of index.js's localESLintRange returned no entries. Ah, I see that localESLintRange is coming directly from my package.json. I see from the code that the migration doesn't have to run in my case. I was already on ESLint 6 so the migration just bails. but that doesn't help you guys track down why it is crashing. This crashed on my setup when my eslint line in package.json was:
|
I am continuing to look into eslint further because after the upgrade, compiling my code, with yarn run serve, kicks out a lot of linting errors (formatting issues like spaces) that weren't there before. Those errors aren't showing up in VSCode because I think I am using prettier for formatting. I noticed that if I didn't have any eslint installed, the migration would have installed eslint, babel-eslint and eslint-plugin-vue. I have eslint and eslint-plugin-vue installed, but I don't have babel-eslint. Do you know if that is needed? This project was created about a month ago with vue cli 3. |
babel-eslint might be needed if you want to parse modern JS features that the default eslint parser doesn't understand. |
Version
4.3.0
Environment info
Steps to reproduce
On my project, I did the following:
yarn global upgrade @vue/cli
this gave me 4.3.0 (from 4.2.3)
then I ran the upgrade like the docs said to do:
vue upgrade
this cranked along for a while running all the upgrades and then the migrations and crashed on the cli-plugin-eslint migration.
I use separate config files.
What is expected?
I expected the upgrade to run without errors.
What is actually happening?
everything was humming along until
I guess I also hoped that it would continue to run the other migrations that might be needed even though one of them in the chain crashed. At this point, I don't know what other migrations didn't get run.
the contents of my .eslintrc.js file:
The text was updated successfully, but these errors were encountered: