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

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

Open
allenhwkim opened this issue May 27, 2018 · 4 comments

Comments

@allenhwkim
Copy link

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 <allen.kim@rci.rogers.ca>
? 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

> fsevents@1.2.4 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

> uglifyjs-webpack-plugin@0.4.6 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

> my-webpack-simple@1.0.0 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
@tamtm
Copy link

tamtm commented May 28, 2018

same issue with webpack template :(

@tamtm
Copy link

tamtm commented May 28, 2018

I think I'm gonna start to config by myself

@nomad-lw
Copy link

nomad-lw commented May 28, 2018

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".

@Good-Coffee
Copy link

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 prettier@1.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants