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

Issues upgrading #106

Closed
kentcdodds opened this issue Jul 16, 2015 · 17 comments
Closed

Issues upgrading #106

kentcdodds opened this issue Jul 16, 2015 · 17 comments

Comments

@kentcdodds
Copy link

I was 0.10.1 and now I'm upgrading to the latest 0.15.4) and I'm getting these errors:

ERROR in .//css-loader!.//less-loader!./app/components/index.less
Module build failed: TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.relative (path.js:498:3)
at /Users/kentcdodds/Developer/alianza/admin-portal/node_modules/loader-utils/index.js:92:23
at Array.map (native)
at Object.exports.stringifyRequest (/Users/kentcdodds/Developer/alianza/admin-portal/node_modules/loader-utils/index.js:90:33)
at /Users/kentcdodds/Developer/alianza/admin-portal/node_modules/css-loader/lib/loader.js:50:46
at Array.map (native)
at Object.module.exports (/Users/kentcdodds/Developer/alianza/admin-portal/node_modules/css-loader/lib/loader.js:43:5)
@ ./app/components/index.less 4:14-122

I'll try to narrow down the version where this was introduced, but if you have something off the top of your head, that would be awesome. I have loader-utils 0.2.9

@kentcdodds
Copy link
Author

Alrighty, updating loader-utils to 0.2.10 fixes the error in the terminal. But I now go from this:

screen shot 2015-07-16 at 9 59 09 am

To this:

screen shot 2015-07-16 at 10 13 12 am

Not sure what's going on here. I'm still working on investigating the version of css-loader that introduced this issue for me.

@kentcdodds
Copy link
Author

Discovered that between 0.14.0 and 0.13.1, my transitions are no longer working. Still not sure what the problem is, but will report more as I go... Any info or ideas you have would be helpful :-)

@kentcdodds
Copy link
Author

The weird scrunching of my login screen starts between 0.15.0 and 0.14.5...

@sokra
Copy link
Member

sokra commented Jul 18, 2015

Weird... Maybe you can do a diff on the bundles

@kentcdodds
Copy link
Author

Here's the relevant diff (between 0.14.5 on the left and 0.15.0 on the right):

screen shot 2015-07-20 at 11 38 18 am

Looks like it's an issue with the css-loader not liking my .\\-- escapes. I use this everywhere (I use a variant on csstyle). I believe this is a bug. Any ideas on a fix?

@JonDum
Copy link

JonDum commented Feb 18, 2016

I'm getting this error now too. :(

ERROR in ./~/css-loader!./~/stylus-loader!./src/styles.styl Module build failed: TypeError: path must be a string

Any idea?

To reproduce:

git clone git@github.com:JonDum/ractive-colorpicker.git
cd ractive-colorpicker
npm i
webpack

@anaibol
Copy link

anaibol commented Feb 28, 2016

  • 1

@rohanthewiz
Copy link

I had the same problem. It seems older versions of stylus-loader (^1.4.2) don't play well with later versions of stylus (^0.54.5 in my case).
The package.json I inherited called for stylus-loader: 1.4.2, but package.json didn't include a locked-in version of stylus, so npm loaded the latest stylus(0.54.5 currently). I was getting the "path must be a string error".
The solution is to bump your stylus-loader dependency to something later (^2.0.0 current latest). To spare a future developer loss of hair, add stylus to your package json and reinstall:

  • npm install --save-dev stylus get a version of stylus locked into package.json as a dev dependency
  • rm -rf node_modules clean the slate (there is probably a more efficient way to do this)
  • npm install fresh install

@KATT
Copy link

KATT commented May 17, 2016

+1 @rohanthewiz

I got the issue when going to node 6.1.

npm uninstall --save --save-dev stylus stylus-loader style-loader
npm install --save-dev stylus stylus-loader style-loader

@rohanthewiz
Copy link

So the reinstall fixed it, right? If so that is the more efficient way I was looking for +1 @KATT

@bbalan
Copy link

bbalan commented Jun 25, 2016

I got the same error as @JonDum and uninstalling did nothing. My package.json:

"css-loader": "~0.23.1",
"stylus": "^0.54.5",
"stylus-loader": "^2.1.1",
"webpack": "^1.13.1",

@phun-ky
Copy link

phun-ky commented Sep 27, 2016

I'm having the same issue:

"css-loader": "0.25.0",
"style-loader": "0.13.1",
"stylint": "1.5.6",
"stylint-loader": "1.0.0",
"stylint-stylish": "1.3.2",
"stylus": "0.54.5",
"stylus-loader": "1.6.1",
"webpack": "1.13.2",

node v: 6.6.0
npm v: 3.10.8

@chogarcia
Copy link

I am having the same issue. None of the above worked for me

@YamiOdymel
Copy link

Modify your plugins option if you are using WebPack 2,

and change sass to stylus or something
(Because I don't use stylus, so I don't know how's the options of stylus look like)

This is the "key" option:

sassLoader:
{
    includePaths: [path.resolve(__dirname, 'src', 'scss')]
},
context: '/'

so you would have to change your plugins option to something like this:

new webpack.LoaderOptionsPlugin
({
    options:
    {
        babel:
        {
            // ...
        },
        sassLoader:
        {
            includePaths: [path.resolve(__dirname, 'src', 'scss')]
        },
        context: '/'
    }
}),

Read more: webpack-contrib/sass-loader#285

@stygmah
Copy link

stygmah commented Feb 17, 2017

Didn't even need to change any module, remove modules & npm install and it worked.

@xuxinhang
Copy link

It seems that the high version of css-loader cannot work with the old version of Webpack.

@saranshgupta1995
Copy link

I was running into the same issue. Downgrading to
"css-loader": "^1.0.1",
worked for me.
Seems like webpack 3 and css-loader@2.x.y don't mix well

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