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

Prettier broke Nuxt 1.4 #3385

Closed
Diolor opened this issue May 28, 2018 · 23 comments
Closed

Prettier broke Nuxt 1.4 #3385

Diolor opened this issue May 28, 2018 · 23 comments

Comments

@Diolor
Copy link

Diolor commented May 28, 2018

Version

v1.4.0

Reproduction link

prettier/prettier#4567

Steps to reproduce

TL;DR: Nuxt 1.4 is now broken either dev or prod mode.

Prettier 1.13 had a regression in Vue: prettier/prettier#4567

Now Nuxt 1.4 uses vue-loader 13.7 which depends and uses old versions of component-compiler-utils.
There was a fix yesterday in component-compiler-utils to fix the regression of Prettier: vuejs/component-compiler-utils#15

The new stable version of component-compiler-utils is 1.3.0.
In order nuxt to work properly and use the version with the fix, it should migrate vue-loader to 15.2 (as is in Nuxt v2).

What is expected ?

No error

What is actually happening?

Compilation error in 1.4

This bug report is available on Nuxt.js community (#c7164)
@ghost ghost added the cmty:bug-report label May 28, 2018
@Diolor
Copy link
Author

Diolor commented May 28, 2018

Hope the explanation is clear. My brain melted trying to explain the dependencies here 😄

@denniszon
Copy link

It's also possible to use vue-loader versions 13.7.2 or 14.2.3 those are also hotfixed. (See vuejs/vue-loader#1323). Nuxt 1.4 has a dependency for "13.7.0" which should be "^13.7.0" so it will use 13.7.2

@Diolor
Copy link
Author

Diolor commented May 28, 2018

Ah thanks @denniszon! Didn't notice this one. Then nothing to do here, newer will get picked up from nuxt 👍

@Diolor Diolor closed this as completed May 28, 2018
@shivgarg5676
Copy link

shivgarg5676 commented May 28, 2018

@Diolor When this is going to be fixed and hotfix released for nuxt 1.4.0. In nuxt's package.json vue-loader version is still 13.7.0 instead of ^13.7.0
I am unable to set up a new nuxt app.

@denniszon
Copy link

@Diolor I think you misunderstood me. I ment to say that Nuxt 1.4 is using the syntax "vue-loader": "13.7.0" in the package.json. Which is wrong and should use "vue-loader": "^13.7.0" so when you use npm it will retrieve version 13.7.2 instead of version 13.7.0 which it will retrieve at the moment. So this problem is not fixed at the moment.

@shivgarg5676
Copy link

@Diolor please open the issue till it is fixed. so that other users can refer.

@Diolor Diolor reopened this May 28, 2018
@Diolor
Copy link
Author

Diolor commented May 28, 2018

@shivgarg5676 you can manually set the Vue-loader version until this is fixed:

"vue-loader": "13.7.2"

@ausir0726
Copy link

ausir0726 commented May 29, 2018

for this problem ,I review all my nuxt project ,
seems like even nuxt fixed 1.4.x ... but if my project lock nuxt verion on 1.0.0.rc.8 or else
it will be problem forever ,

so , if want fix this problem without update nuxt

for yarn , can add resolutions to package.json and execute yarn install

...
"resolutions": {
    "prettier": "1.12.0"
  }
...

for npm , can npm i prettier@1.12.0 --save-dev

....

btw , I fixed my about 20 project yesterday ... 😢

@denniszon
Copy link

For our projects we fixed it with: yarn add vue-loader@13.7.2 --dev or npm i vue-loader@13.7.2 --save-dev. No need for resolutions with this solution in the package.json

@gaofei019
Copy link

npm i prettier@~1.12.0 这个是降版本 因为是更新成1.13.0崩的

@pi0
Copy link
Member

pi0 commented May 29, 2018

This should be fixed with the latest release of vue-loader (Also fixed on nuxt-edge). Simply use yarn upgrade :)

@pi0 pi0 closed this as completed May 29, 2018
@shivgarg5676
Copy link

shivgarg5676 commented May 29, 2018

@pi0 This is fixed in vue-loader(13.7.2). But It will not get solved in nuxt repositories using nuxt version 1.4.0. Because in package-json of nuxt 1.4.0 vue-loader version is explicitly specified as 13.7.0 instead of ^13.7.0. So yarn update won't install the new version of vue-loader(it will not install 13.7.2(fixed one))

Please see this link to verify that this will not update vue loader version.
https://github.com/nuxt/nuxt.js/blob/v1.4.0/package.json

@Diolor @pi0 Please reopen the issue. So that others can refer

@pi0 pi0 reopened this May 29, 2018
@shivgarg5676
Copy link

shivgarg5676 commented May 30, 2018

@Diolor @pi0 How can we solve this issue? Should we create a separate branch from tag 1.14.0 and do the changes in that branch and then build and publish npm package from that branch?
Because we will not be able to merge that branch as version in package.json is moved forward in master branch

@Diolor
Copy link
Author

Diolor commented May 30, 2018

That's the correct way to go @shivgarg5676 💪
Also for the PR you will need to target a branch that the maintainers here should create from that version.
Core maintainers will know about the release/branch flow here :)

@jankal
Copy link

jankal commented Jun 1, 2018

Just freakin put that ^ in there so everyone is happy. When nobody sends a PR here, I will do.

@jankal
Copy link

jankal commented Jun 1, 2018

I got the fix on my branch. To which branch should I send my PR now? @pi0

@14nrv
Copy link

14nrv commented Jun 3, 2018

(On master it' s fixed)

@jankal
Copy link

jankal commented Jun 3, 2018

@14nrv As far as I see, master is for development of nuxt.js v2 right now.

@14nrv
Copy link

14nrv commented Jun 3, 2018

@jankal sorry, I was thinking that nuxt-edge was only on the dev branch because it s v2.0.0 on the package.json and v1 on master

@jankal
Copy link

jankal commented Jun 3, 2018

@14nrv sorry, I just checked back on master. Master is at 1.2.0 as package.json states.

@sky-code
Copy link

sky-code commented Jun 5, 2018

when new release?
536 commits to dev since 1.4.0 release.

pi0 pushed a commit that referenced this issue Jun 6, 2018
@clarkdo
Copy link
Member

clarkdo commented Jun 6, 2018

A patch release v1.4.1 for the quick fix has been published.

@clarkdo clarkdo closed this as completed Jun 6, 2018
@nuxt nuxt locked as resolved and limited conversation to collaborators Jun 6, 2018
@clarkdo
Copy link
Member

clarkdo commented Jun 6, 2018

@sky-code
2.0.0 will be released in June.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Bugs 🐞
  
Fixed
Development

No branches or pull requests