https://github.com/prettier/prettier/issues/4567
TL;DR: Nuxt 1.4 is now broken either dev or prod mode.
Prettier 1.13 had a regression in Vue: https://github.com/prettier/prettier/issues/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: https://github.com/vuejs/component-compiler-utils/pull/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).
No error
Compilation error in 1.4
Hope the explanation is clear. My brain melted trying to explain the dependencies here 馃槃
It's also possible to use vue-loader
versions 13.7.2
or 14.2.3
those are also hotfixed. (See https://github.com/vuejs/vue-loader/pull/1323). Nuxt 1.4 has a dependency for "13.7.0"
which should be "^13.7.0"
so it will use 13.7.2
Ah thanks @denniszon! Didn't notice this one. Then nothing to do here, newer will get picked up from nuxt 馃憤
@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.
@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.
@Diolor please open the issue till it is fixed. so that other users can refer.
@shivgarg5676 you can manually set the Vue-loader version until this is fixed:
"vue-loader": "13.7.2"
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 [email protected] --save-dev
....
btw , I fixed my about 20 project yesterday ... 馃槩
For our projects we fixed it with: yarn add [email protected] --dev
or npm i [email protected] --save-dev
. No need for resolutions with this solution in the package.json
npm i prettier@~1.12.0 杩欎釜鏄檷鐗堟湰 鍥犱负鏄洿鏂版垚1.13.0宕╃殑
This should be fixed with the latest release of vue-loader
(Also fixed on nuxt-edge). Simply use yarn upgrade
:)
@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
@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
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 :)
Just freakin put that ^
in there so everyone is happy. When nobody sends a PR here, I will do.
I got the fix on my branch. To which branch should I send my PR now? @pi0
(On master it' s fixed)
@14nrv As far as I see, master is for development of nuxt.js v2 right now.
@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
@14nrv sorry, I just checked back on master. Master is at 1.2.0 as package.json states.
when new release?
536 commits to dev since 1.4.0 release.
A patch release v1.4.1 for the quick fix has been published.
@sky-code
2.0.0
will be released in June.
Most helpful comment
@Diolor please open the issue till it is fixed. so that other users can refer.