Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vue webpack template missing parser

I was just setting up a vue project using the webpack template like stated here: http://vuejs-templates.github.io/webpack/

However after running npm run dev just to test that the template is working, I get this error:

Failed to compile with 2 errors                                                                                                                                                                                                                                                           21:49:02  error  in ./src/App.vue  Module build failed: Error: No parser and no file path given, couldn't infer a parser.     at normalize (path\node_modules\prettier\index.js:7051:13)     at formatWithCursor (path\node_modules\prettier\index.js:10370:12)     at path\node_modules\prettier\index.js:31115:15     at Object.format (path\node_modules\prettier\index.js:31134:12)     at Object.module.exports (path\node_modules\vue-loader\lib\template-compiler\index.js:80:23)   @ ./src/App.vue 11:0-354  @ ./src/main.js  @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js   error  in ./src/components/HelloWorld.vue  Module build failed: Error: No parser and no file path given, couldn't infer a parser.     at normalize (path\node_modules\prettier\index.js:7051:13)     at formatWithCursor (path\node_modules\prettier\index.js:10370:12)     at path\node_modules\prettier\index.js:31115:15     at Object.format (path\node_modules\prettier\index.js:31134:12)     at Object.module.exports (path\node_modules\vue-loader\lib\template-compiler\index.js:80:23) 

What am I doing wrong?

like image 786
tobire Avatar asked May 27 '18 19:05

tobire


2 Answers

Prettier has caused this regression in their 1.13.0 update which occurred today. Downgrade to the previous version to fix this error:

npm install --save-dev [email protected]

npm run dev

That should do the trick.

like image 139
Jesse Hallam Avatar answered Sep 19 '22 05:09

Jesse Hallam


it is fixed in [email protected] and [email protected]. So just upgrade.

like image 24
pmbanugo Avatar answered Sep 20 '22 05:09

pmbanugo