You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Error can't find module when using less-loader and "module" options #74
That is interesting. When I migrated our sprockets build with sass and all that kind of stuff - I had almost no issues. The only issue I had was - not correctly resolved path inside imported files and different mixins. But in general everything worked like a charm.
Erm... I can't reproduce this is a new project. Here's what I tried [dead]. Will post again if I figure out to cause, unless maybe it was fixed recently.
Activity
nkbt commentedon Jun 9, 2015
@zxcabs are you using your
pngfile in a mixin or something (not actuallessfile you require, but some other file somehow importedless-way)?zxcabs commentedon Jun 10, 2015
@nkbt No, it's simple less file
nkbt commentedon Jun 10, 2015
That is hard to tell, could be even some typo... If you could make a simple repo to reproduce the issue
zxcabs commentedon Jun 10, 2015
https://github.com/zxcabs/webpack-css-module-less-error
markdalgleish commentedon Jun 10, 2015
I'm actually having the same issue trying to convert my current project to CSS Modules.
nkbt commentedon Jun 10, 2015
That is interesting. When I migrated our sprockets build with sass and all that kind of stuff - I had almost no issues. The only issue I had was - not correctly resolved path inside imported files and different mixins. But in general everything worked like a charm.
nkbt commentedon Jun 10, 2015
non-module mode
loaderUtils.urlToRequest(url, root)returns
url("+require("./cat.png")+")module mode
require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")gives
url("+require("cat.png")+")zxcabs commentedon Jun 10, 2015
can anybody fix it? 😺
nkbt commentedon Jun 10, 2015
@zxcabs I kind of debugged all the chain and it is quite clear where exactly the issue, but that code was written on purpose...
When I changed:
to
Everything works fine.
nkbt commentedon Jun 10, 2015
@zxcabs @markdalgleish lol, you know what worked?
No changes to loader at all.
zxcabs commentedon Jun 10, 2015
oh 😄
moroshko commentedon Dec 27, 2015
Any update on this?
markdalgleish commentedon Jan 7, 2016
@moroshko we're still waiting to hear back on this issue in Less: less/less.js#2615
safhac commentedon Mar 24, 2016
Not sure if this still an issue?, but this could be cause your package json has less in devdeps have you tried less-loader instead of less?
39 remaining items
bradennapier commentedon Jun 16, 2017
hmm this seems to be an issue when just using postcss-loader as well.
artialex commentedon Jul 14, 2017
adding resolve-url-loader fixes this for me
...!resolve-url!less...alexander-akait commentedon Jul 14, 2017
@mnpenner @bradennapier can your provide minimum reproducible test repo?
mnpenner commentedon Jul 14, 2017
Erm... I can't reproduce this is a new project.
Here's what I tried[dead]. Will post again if I figure out to cause, unless maybe it was fixed recently.alexander-akait commentedon Jul 14, 2017
For me, bug not related to
css-loader. Seems more related toless/sass/etc/-loader.smashercosmo commentedon Aug 29, 2017
This is what worked for me. Add to webpack config the following lines
ishenli commentedon Jan 28, 2018
@smashercosmo I can not understand why it works。。It is surprise
Spaxe commentedon Apr 9, 2018
Just traced my
postcss-loaderissue all the way here! Wow. Please fix. :)viT-1 commentedon Jan 26, 2024
Still a bug with scss files and sass-loader (v8.0.2):
css-loader (v6.9.1)
Error: Cannot find module '/img/ajax-loader.gif'"resolve" / "modules" setting is not helped