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

"TypeError: Path must be a string" after break from project #2463

Closed
kingscott opened this issue May 10, 2016 · 55 comments · May be fixed by goatslacker/alt#706
Closed

"TypeError: Path must be a string" after break from project #2463

kingscott opened this issue May 10, 2016 · 55 comments · May be fixed by goatslacker/alt#706
Labels

Comments

@kingscott
Copy link

I updated packages and all seemed fine. I took a week break from the project, ran npm install and cannot seem to figure out the cause of this error. It's on this repo.

For convenience here is the error message and specs:

ERROR in ./src/app.js
Module build failed: TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1429:5)
    at processText (/home/kingscott/newton/node_modules/standard/node_modules/eslint/lib/cli-engine.js:144:30)
    at CLIEngine.executeOnText (/home/kingscott/newton/node_modules/standard/node_modules/eslint/lib/cli-engine.js:671:26)
    at Linter.lintText (/home/kingscott/newton/node_modules/standard-engine/index.js:65:59)
    at Object.standardLoader (/home/kingscott/newton/node_modules/standard-loader/index.js:19:12)
 @ multi app

and my packages:

"dependencies": {
    "material-ui": "^0.15.0-alpha.2",
    "react": "^15.0.2",
    "react-dom": "^15.0.2",
    "react-tap-event-plugin": "^1.0.0",
    "recompose": "^0.17.0"
  },
  "engines": {
    "node": "0.12.7"
  },
  "devDependencies": {
    "babel": "^5.8.21",
    "babel-core": "^5.8.22",
    "babel-loader": "^5.3.2",
    "standard": "^6.0.8",
    "standard-loader": "^3.0.0",
    "webpack": "^1.13.0",
    "webpack-dev-server": "^1.14.1"
  }

If you check out the repo, you can see my server.js and webpack.config.js.

Thanks.

@bebraw bebraw added the bug label May 10, 2016
@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

Could you try upgrading to standard 7? Feels like a standard related bug to me.

@kingscott
Copy link
Author

The error persists. I've swapped out some of my code (new build processes for old etc), updated/downgraded packages. And not sure what it is.

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

Ok. The next step would be digging into ESLint. Maybe logging near the offending line would give better insight. It might stem from standard-loader configuration somehow so that's another place to inspect.

@kingscott
Copy link
Author

Hmm, we'd have to dig into ESLint even if I'm not explicitly using ESLint?

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

See processText at the trace.

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

What command do I have to run to repro? I tried a few, no luck. I see

ERROR in ./src/app.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../backgrounds.js in ../king/src
 @ ./src/app.js 25:21-49

though.

@kingscott
Copy link
Author

I can include that file. I excluded it from source control and would prefer to have it not on GitHub. I can email you the file, and then you would just checkout the nasa-update branch and run:

~  npm install
➜  ~  npm start

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

Works for me.

king [nasa-update] $ npm start

> [email protected] start .../king
> NODE_ENV=development node server.js

Listening at localhost:2020
Hash: 22dd0f5206c2641317ba
Version: webpack 1.13.0
Time: 3776ms
             Asset     Size  Chunks             Chunk Names
    ./lib/build.js   980 kB       0  [emitted]  app
./lib/build.js.map  1.15 MB       0  [emitted]  app
chunk    {0} ./lib/build.js, ./lib/build.js.map (app) 924 kB [rendered]

WARNING in ./src/app.js
<text>:22:8: Closing curly brace does not appear on the same line as the subsequent block.
webpack: bundle is now VALID.

Maybe I'm missing something. Running on OS X so that could be it. There's some difference.

@kingscott
Copy link
Author

If you navigate to localhost:2020 what do you get?

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

It shows some photo background and time(?) then.

@kingscott
Copy link
Author

Hmm weird. I was getting the same error on OS X as well as Linux.

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

It's really hard for me to say anything concrete. You would have to look at the stack trace and go from there. Perhaps someone else can repro.

In any case, this might fit Stack Overflow better as it seems the issue is somewhere else than webpack core.

@kingscott
Copy link
Author

I am slightly confused as to why you cannot replicate the bug, what version of node and npm are you running?

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

king [nasa-update] $ node -v
v5.10.1
king [nasa-update] $ npm -v
3.8.3

@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

I've seen some weird Node 6 reports so maybe that's it?

@kingscott
Copy link
Author

Must be a node problem. Downgraded to node 5.11.1 and it works. Thanks for the help, you can close.

👍

@bebraw bebraw closed this as completed May 10, 2016
@bebraw
Copy link
Contributor

bebraw commented May 10, 2016

Ok. You could consider reporting this upstream to standard-loader.

@kingscott
Copy link
Author

I'll give it a shot, thanks @bebraw.

@felix-d
Copy link

felix-d commented May 15, 2016

Had the same issue and no stack trace to help me debug this whatsoever. Downgraded from node 6 to 5 and... success! Thanks!

@wiiiim
Copy link

wiiiim commented May 15, 2016

same here 👍

@kingscott
Copy link
Author

Hey @felix-d @wiiiim, this helped me in the end!

Cheers!

@bebraw bebraw reopened this May 24, 2016
@bebraw bebraw added the node6 label May 28, 2016
@JohnnyMa
Copy link

JohnnyMa commented Jun 4, 2016

Great! It helps me to resolve the same issue. Thanks! 👍

@jkomyno
Copy link

jkomyno commented Jun 8, 2016

Thank you guys!

@yarhtut
Copy link

yarhtut commented Jun 26, 2016

Thanks you guys

@dace
Copy link

dace commented Jul 9, 2016

Yeah, downgraded from Node 6.2 to 5.12 and this resolved the issue for me. Thanks!!

@jcubic
Copy link

jcubic commented Oct 20, 2016

@binarious did you try to update node-sass or sass-loader?

@binarious
Copy link

@jcubic both are at their latest versions.

@binarious
Copy link

Seems to be a bug somewhere else: webpack-contrib/sass-loader#285

@ximet
Copy link

ximet commented Nov 5, 2016

I have the same problem. Env: node.js version: 7, "webpack": "1.13.3", "babel-loader": "6.2.7", "react-hot-loader": "1.3.0", "babel-core": "6.18.2". Other loader is missing.

@flyskywhy
Copy link

This issue is resolve in taofed/react-web#136 :

use node 5.x instead of node 6

or

add a key 'publicPath' to the webpack config output node

output:{
    publicPath:''
}

fritx added a commit to fritx/react-at that referenced this issue Dec 14, 2016
webpack/webpack#2463 (comment)
- includes missing jquery as devDep
- upgrades some other deps
- improves README
tyrasd added a commit to hotosm/osm-analytics that referenced this issue Jan 8, 2017
solves some strange compatibility issues, see webpack/webpack#2463 (comment)
@bolivar
Copy link

bolivar commented Jan 25, 2017

Upgrading npm solved my problem but thanks a lot guys!!!

@bpartridge
Copy link

For anyone who hasn't upgraded NPM recently, use npm install -g npm per @bolivar's suggestion.

@ehsankhf
Copy link

ehsankhf commented Mar 8, 2017

Webpack update was the perfect solution for this issue. I'd like just to add a comment on how to update the npm packages easier. You'd need to run the following three commands in your project's root directory:

npm i -g npm-check-updates
npm-check-updates -u
npm install

@ruoru
Copy link

ruoru commented Jun 27, 2017

i meet the same question

➜  ~ node -v
v8.1.0
➜  ~ npm -v
5.0.4

the error message

ERROR in ./app/index.js
Module build failed: TypeError: Path must be a string. Received undefined

and i update my babel-core version to 6.11.4, it`s work well
@yorkie Great! It helps me.

@29er
Copy link

29er commented Jul 11, 2017

I had to downgrade to node 6.11 ( I was on 8 ) and upgrade to babel-core to 6.11.4 and it worked.
doing one or the other did NOT work. FYI

@greygatch
Copy link

Had to downgrade to node v5.12 and babel-core is at v6.25.

Annoying that I can't even use the LTS version of Node.

@Pie4kaiz
Copy link

I got it working now after using ncu (npm-check-updates) to fetch the latest versions:

react-redux          ^5.0.5  →  ^5.0.6
eslint-plugin-react  ^7.1.0  →  ^7.2.0
webpack              ^3.5.1  →  ^3.5.2
webpack-dev-server   ^2.7.0  →  ^2.7.1

Node: v8.2.1
NPM: 5.3.0

fritx added a commit to fritx/react-at that referenced this issue Nov 6, 2017
webpack/webpack#2463 (comment)
- includes missing jquery as devDep
- upgrades some other deps
- improves README
@pkerpedjiev
Copy link

I get this error using:

NPM: 5.6.0
NODE: 9.9.0
webpack-dev-server: 2.6.1

It disappears if I remove the devtool: 'cheap-source-map' option from my webpack.config.js.

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

Successfully merging a pull request may close this issue.