Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Vue preset broken after Prettier 1.13.0 release #913

Closed
edmorley opened this issue May 28, 2018 · 2 comments · Fixed by #912
Closed

Vue preset broken after Prettier 1.13.0 release #913

edmorley opened this issue May 28, 2018 · 2 comments · Fixed by #912
Assignees
Labels

Comments

@edmorley
Copy link
Member

Prettier 1.13.0 made a breaking change to their API, which causes the following error during yarn start when using @neutrinojs/vue:

ERROR in ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-04c2046b","hasScoped":false,"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/App.vue
Module build failed: Error: No parser and no file path given, couldn't infer a parser.
    at normalize (C:\Users\Ed\src\vue-test\node_modules\prettier\index.js:7051:13)
    at formatWithCursor (C:\Users\Ed\src\vue-test\node_modules\prettier\index.js:10370:12)
    at C:\Users\Ed\src\vue-test\node_modules\prettier\index.js:31115:15
    at Object.format (C:\Users\Ed\src\vue-test\node_modules\prettier\index.js:31134:12)
    at Object.module.exports (C:\Users\Ed\src\vue-test\node_modules\vue-loader\lib\template-compiler\index.js:80:23)

This has been fixed upstream in vuejs/component-compiler-utils#15, however that package is only used by vue-loader v15, and we're using vue-loader v14 on master and v13 on release/v8, which still have the old behaviour:
https://github.com/vuejs/vue-loader/blob/v13.7.0/lib/template-compiler/index.js#L80
https://github.com/vuejs/vue-loader/blob/v14.2.2/lib/template-compiler/index.js#L73

We can fix on master by updating to vue-loader v15, however for release/v8 our options are:

  • update from vue-loader v13 to v15 even though it's a breaking change
  • ask if there could be a vue-loader 13.x backport of the fix
  • use yarn the resolutions to downgrade the prettier subdependency to 1.12.1 (but this doesn't help npm - though I really don't want to make another temporarily forked package like we did for babel-minify-webpack-plugin)
@edmorley
Copy link
Member Author

I've opened PRs against both vue-loader 13 and 14:
vuejs/vue-loader#1322
vuejs/vue-loader#1323

@azz
Copy link

azz commented May 28, 2018

Looks like it is fixed in vue-loader@13.7.2 and vue-loader@14.2.3.

edmorley added a commit that referenced this issue May 28, 2018
To fix the Vue preset failures on master due to the Prettier
breaking API change in 1.13.0:
vuejs/component-compiler-utils#15
 vuejs/vue-loader#1323

The lockfile has been updated manually since Renovate's weekly PR
isn't currently working:
renovatebot/renovate#2033

Fixes #913.
@edmorley edmorley self-assigned this May 28, 2018
edmorley added a commit that referenced this issue May 28, 2018
To fix the Vue preset failures on master due to the Prettier
breaking API change in 1.13.0:
vuejs/component-compiler-utils#15
vuejs/vue-loader#1323

Closes #913.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

2 participants