style-loader: Error: Can't resolve './fixUrls'
Do you want to request a feature or report a bug?
Possible bug.
What is the current behavior? Upgrading from 0.13.2 to 0.16.1 produces an error.
ERROR in ../~/style-loader/addStyles.js
Module not found: Error: Can't resolve './fixUrls' in '/Users/jeff/WebstormProjects/admin/node_modules/style-loader'
@ ../~/style-loader/addStyles.js 35:11-31
@ ./client/css/_main.scss
@ ./client/pack.js
The fixUrls.js
file is located in my node_modules/style-loader
directory, but it is not being resolved correctly by the require
statement in addStyles.js
:
35 fixUrls = require("./fixUrls");
Here is a listing of my style-loader
directory:
$ ls -lFa node_modules/style-loader/
total 344
drwxr-xr-x 18 jeff staff 612B Apr 7 14:47 ./
drwxr-xr-x 744 jeff staff 25K Apr 7 15:11 ../
-rw-r--r-- 1 jeff staff 73B Mar 14 21:12 .gitattributes
drwxr-xr-x 4 jeff staff 136B Feb 28 13:00 .github/
-rw-r--r-- 1 jeff staff 10B Feb 24 08:02 .npmignore
-rw-r--r-- 1 jeff staff 915B Mar 14 21:12 .travis.yml
-rw-r--r-- 1 jeff staff 2.5K Mar 28 06:28 CHANGELOG.md
-rw-r--r-- 1 jeff staff 1.0K Feb 24 08:02 LICENSE
-rw-r--r-- 1 jeff staff 6.1K Mar 22 06:43 README.md
-rw-r--r-- 1 jeff staff 1.0K Mar 22 06:43 addStyleUrl.js
-rw-r--r-- 1 jeff staff 8.3K Mar 22 06:43 addStyles.js
-rw-r--r-- 1 jeff staff 2.9K Mar 20 19:21 fixUrls.js
-rw-r--r-- 1 jeff staff 1.5K Mar 14 21:12 index.js
-rw-r--r-- 1 jeff staff 649B Mar 28 06:28 package.json
drwxr-xr-x 5 jeff staff 170B Apr 7 14:47 test/
-rw-r--r-- 1 jeff staff 1.0K Mar 22 06:43 url.js
-rw-r--r-- 1 jeff staff 1.4K Mar 28 06:26 useable.js
-rw-r--r-- 1 jeff staff 107K Mar 14 21:21 yarn.lock
Same as #206, which was subsequently closed by the author.
If the current behavior is a bug, please provide the steps to reproduce.
My config: https://gist.github.com/jeff-kilbride/e58a6831546efeb43fef8fae6b2d1da6
What is the expected behavior? Should upgrade without errors.
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as your webpack version, Node.js version and Operating System. Webpack 2.3.3 Node 6.10.2 Mac OSX Sierra 10.12.3
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
@michael-ciniawsky Ok, I think I’ve solved this. Your nudge to look at the
resolve
config in mywebpack.config.js
file helped.From the
webpack
docs, extensions in theresolve
config are supposed to have a leading.
: https://webpack.js.org/configuration/resolve/#resolve-extensionsSo, I changed my
resolve
config to:And now things are working. I guess I haven’t hit this before, because I’m only using
webpack
for css and images – so, there’s not much resolving going on.Sorry for the trouble! At the very least, I hope my flailing around with this helps someone else…
Downgrading to
0.13.2
resolves the problem. I’ve tried all versions between0.13.2
and0.16.1
. It looks like it first occurs in0.14.0
.Let me know if there is anything else I can provide.