webpack-simple icon indicating copy to clipboard operation
webpack-simple copied to clipboard

Module build failed: Error: No parser and no file path given, couldn't infer a parser.

Open allenhwkim opened this issue 7 years ago • 4 comments

Hi,

I tried the instruction as defined at README.md, but having this error

I would appreciate if you let me know what I am missing.

github$  clear
github$  node --version
v9.4.0
github$  vue init webpack-simple my-webpack-simple

? Project name my-webpack-simple
? Project description A Vue.js project
? Author Allen Kim <[email protected]>
? License MIT
? Use sass? No

   vue-cli · Generated "my-webpack-simple".

   To get started:

     cd my-webpack-simple
     npm install
     npm run dev

github$  cd my-webpack-simple/
my-webpack-simple$  npm install

> [email protected] install /Users/allen.kim/github/my-webpack-simple/node_modules/fsevents
> node install

[fsevents] Success: "/Users/allen.kim/github/my-webpack-simple/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node" is installed via remote

> [email protected] postinstall /Users/allen.kim/github/my-webpack-simple/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
added 873 packages from 596 contributors in 11.413s
my-webpack-simple$  npm run dev

> [email protected] dev /Users/allen.kim/github/my-webpack-simple
> cross-env NODE_ENV=development webpack-dev-server --open --hot

Project is running at http://localhost:8080/
webpack output is served from /dist/
404s will fallback to /index.html
Hash: 23fb559f4bad161fd293
Version: webpack 3.12.0
Time: 2148ms
   Asset     Size  Chunks                    Chunk Names
build.js  1.79 MB       0  [emitted]  [big]  main
   [1] (webpack)/hot/log.js 1.04 kB {0} [built]
   [4] (webpack)/hot/emitter.js 77 bytes {0} [built]
   [5] ./node_modules/vue/dist/vue.esm.js 292 kB {0} [built]
   [8] multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js 52 bytes {0} [built]
   [9] (webpack)-dev-server/client?http://localhost:8080 7.93 kB {0} [built]
  [10] ./node_modules/url/url.js 23.3 kB {0} [built]
  [17] ./node_modules/strip-ansi/index.js 161 bytes {0} [built]
  [19] ./node_modules/loglevel/lib/loglevel.js 7.86 kB {0} [built]
  [20] (webpack)-dev-server/client/socket.js 1.08 kB {0} [built]
  [22] (webpack)-dev-server/client/overlay.js 3.67 kB {0} [built]
  [27] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {0} [built]
  [29] (webpack)/hot/dev-server.js 1.61 kB {0} [built]
  [30] (webpack)/hot/log-apply-result.js 1.31 kB {0} [built]
  [31] ./src/main.js 134 bytes {0} [built]
  [34] ./src/App.vue 1.81 kB {0} [built]
    + 27 hidden modules

ERROR in ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-7ba5bd90","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 (/Users/allen.kim/github/my-webpack-simple/node_modules/prettier/index.js:7051:13)
    at formatWithCursor (/Users/allen.kim/github/my-webpack-simple/node_modules/prettier/index.js:10370:12)
    at /Users/allen.kim/github/my-webpack-simple/node_modules/prettier/index.js:31115:15
    at Object.format (/Users/allen.kim/github/my-webpack-simple/node_modules/prettier/index.js:31134:12)
    at Object.module.exports (/Users/allen.kim/github/my-webpack-simple/node_modules/vue-loader/lib/template-compiler/index.js:80:23)
 @ ./src/App.vue 11:0-238
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

allenhwkim avatar May 27 '18 20:05 allenhwkim

same issue with webpack template :(

tamtm avatar May 28 '18 02:05 tamtm

I think I'm gonna start to config by myself

tamtm avatar May 28 '18 02:05 tamtm

There's something wrong with the "prettier" package dependency. Change the package dependency from 1.13.0 to 1.12.1 in "package-lock.json"

works: "prettier": "1.12.1", doesn't work: "prettier": "1.13.0",

then re-run "npm install" & "npm run dev".

nomad-lw avatar May 28 '18 05:05 nomad-lw

Just overwriting the "package-lock.json" file and running npm-install wasn't working for me.

i manually reinstalled prettier v.1.12.1 by running: npm install --save [email protected]

Good-Coffee avatar May 28 '18 10:05 Good-Coffee