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)

Most upvoted comments

@michael-ciniawsky Ok, I think I’ve solved this. Your nudge to look at the resolve config in my webpack.config.js file helped.

From the webpack docs, extensions in the resolve config are supposed to have a leading .: https://webpack.js.org/configuration/resolve/#resolve-extensions

So, I changed my resolve config to:

    resolve: {
        extensions: ['.js', '.jsx', '.css', '.scss', '.sass']
    },

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 between 0.13.2 and 0.16.1. It looks like it first occurs in 0.14.0.

$ yarn upgrade style-loader@0.14.0
yarn upgrade v0.21.3
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ style-loader@0.14.0
✨  Done in 6.26s.

$ npm run dev

> admin@1.0.0 dev /Users/jeff/WebstormProjects/admin/src
> webpack -d --watch


Webpack is watching the files…

Hash: d6f54e8ee01246149381
Version: webpack 2.3.3
Time: 8825ms
                                                              Asset       Size  Chunks                    Chunk Names
    ../css/assets/Roboto-Bold.dc81817def276b4f21395f7ea5e88dcd.woff    62.9 kB          [emitted]
     ../css/assets/Roboto-Bold.ecdd509cadbf1ea78b8d2e31ec52328c.eot      21 kB          [emitted]
   ../css/assets/Roboto-Medium.4d9f3f9e5195e7b074bb63ba4ce42208.eot    21.4 kB          [emitted]
  ../css/assets/Roboto-Regular.30799efa5bf74129468ad4e257551dc3.eot    21.3 kB          [emitted]
     ../css/assets/Roboto-Thin.dfe56a876d0282555d1e2458e278060f.eot    21.7 kB          [emitted]
    ../css/assets/default-skin.e3f799c6dec9af194c86decdf7392405.png  547 bytes          [emitted]
       ../css/assets/preloader.e34aafbb485a96eaf2a789b2bf3af6fe.gif  866 bytes          [emitted]
              ../css/assets/01.0a3750e6fdb29fcd632e627e2fc34dde.png  211 bytes          [emitted]
              ../css/assets/02.351bd6828f980ec53eb3a1ad0d3b1e31.png  213 bytes          [emitted]
              ../css/assets/03.e438ea2aabdb1087dc4f6fea5f6518e7.png  209 bytes          [emitted]
              ../css/assets/04.0284d042a6c29213aaa1979528195b7f.png  211 bytes          [emitted]
              ../css/assets/05.5014f9cce435c71ade6395a5ed0c50e7.png  213 bytes          [emitted]
              ../css/assets/06.21612b9d3e9d84e7e8761a2caf43bc65.png  211 bytes          [emitted]
              ../css/assets/07.f8da0281186df8f17f732a2a22aa0efa.png  215 bytes          [emitted]
              ../css/assets/08.975f7e0074400e7561ba2124604aacf2.png  146 bytes          [emitted]
              ../css/assets/09.fd19309a1932b475138799acc0b75a82.png  137 bytes          [emitted]
     ../css/assets/Roboto-Bold.e31fcf1885e371e19f5786c2bdfeae1b.ttf     128 kB          [emitted]
    ../css/assets/Roboto-Light.a990f611f2305dc12965f186c2ef2690.eot    20.9 kB          [emitted]
   ../css/assets/Roboto-Bold.39b2c3031be6b4ea96e2e3e95d307814.woff2      50 kB          [emitted]
    ../css/assets/Roboto-Light.46e48ce0628835f68a7369d0254e4283.ttf     127 kB          [emitted]
   ../css/assets/Roboto-Light.3b813c2ae0d04909a33a18d792912ee7.woff    62.3 kB          [emitted]
  ../css/assets/Roboto-Light.69f8a0617ac472f78e45841323a3df9e.woff2    49.4 kB          [emitted]
   ../css/assets/Roboto-Medium.894a2ede85a483bf9bedefd4db45cdb9.ttf     127 kB          [emitted]
  ../css/assets/Roboto-Medium.fc78759e93a6cac50458610e3d9d63a0.woff      63 kB          [emitted]
 ../css/assets/Roboto-Medium.574fd0b50367f886d359e8264938fc37.woff2    50.2 kB          [emitted]
  ../css/assets/Roboto-Regular.df7b648ce5356ea1ebce435b3459fd60.ttf     126 kB          [emitted]
 ../css/assets/Roboto-Regular.ba3dcd8903e3d0af5de7792777f8ae0d.woff    61.7 kB          [emitted]
../css/assets/Roboto-Regular.2751ee43015f9884c3642f103b7f70c9.woff2    49.2 kB          [emitted]
     ../css/assets/Roboto-Thin.94998475f6aea65f558494802416c1cf.ttf     128 kB          [emitted]
    ../css/assets/Roboto-Thin.7500519de3d82e33d1587f8042e2afcb.woff    61.6 kB          [emitted]
   ../css/assets/Roboto-Thin.954bbdeb86483e4ffea00c4591530ece.woff2    48.5 kB          [emitted]
    ../css/assets/default-skin.b257fa9c5ac8c515ac4d77a667ce2943.svg    1.55 kB          [emitted]
                                                             app.js    2.44 MB       0  [emitted]  [big]  app
                                                  ../css/styles.css     562 kB       0  [emitted]  [big]  app
   [0] ../~/webpack/buildin/global.js 509 bytes {0} [built]
   [1] ../~/process/browser.js 5.3 kB {0} [built]
   [2] ../~/webpack/buildin/module.js 517 bytes {0} [built]
   [3] ../~/bluebird/js/browser/bluebird.js 179 kB {0} [built]
   [4] ./client/css/_main.scss 41 bytes {0} [built]
   [5] ../~/lodash/lodash.js 540 kB {0} [built]
   [6] ./client/js/date_picker.js 1.21 kB {0} [built]
   [7] ./client/js/datepicker/bootstrap-datetimepicker.min.js 48.9 kB {0} [built]
   [8] ./client/js/video_progress.js 5.61 kB {0} [built]
  [10] ../~/moment/moment.js 129 kB {0} [built]
  [12] ../~/timers-browserify/main.js 1.36 kB {0} [built]
  [13] ./client/pack.js 6.7 kB {0} [built]
  [17] ../~/css-loader!../~/sass-loader/lib/loader.js!./client/css/_main.scss 583 kB [built]
  [32] ../~/style-loader/addStyles.js 7.68 kB [built]
  [54] ./client/img/svg/arrow_left.svg 333 bytes [built]
    + 41 hidden modules

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 22:11-31
 @ ./client/css/_main.scss
 @ ./client/pack.js
Child extract-text-webpack-plugin:
       [2] ./client/font/roboto/Roboto-Medium.eot 110 bytes {0} [built]
       [3] ./client/font/roboto/Roboto-Regular.eot 111 bytes {0} [built]
       [4] ./client/font/roboto/Roboto-Thin.eot 108 bytes {0} [built]
       [5] ../~/css-loader/lib/css-base.js 2.19 kB {0} [built]
       [6] ./client/img/lightbox/default-skin.png 109 bytes {0} [built]
       [7] ./client/img/lightbox/preloader.gif 106 bytes {0} [built]
       [8] ./client/img/overlays/01.png 99 bytes {0} [built]
       [9] ./client/img/overlays/02.png 99 bytes {0} [built]
      [10] ./client/img/overlays/03.png 99 bytes {0} [built]
      [11] ./client/img/overlays/04.png 99 bytes {0} [built]
      [12] ./client/img/overlays/05.png 99 bytes {0} [built]
      [13] ./client/img/overlays/06.png 99 bytes {0} [built]
      [14] ./client/img/overlays/07.png 99 bytes {0} [built]
      [20] ./client/font/roboto/Roboto-Light.ttf 109 bytes {0} [built]
      [37] ../~/css-loader!../~/sass-loader/lib/loader.js!./client/css/_main.scss 583 kB {0} [built]
        + 26 hidden modules
$ yarn upgrade style-loader@0.13.2
yarn upgrade v0.21.3
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ style-loader@0.13.2
✨  Done in 6.02s.

$ npm run dev

> admin@1.0.0 dev /Users/jeff/WebstormProjects/admin/src
> webpack -d --watch


Webpack is watching the files…

Hash: d6f54e8ee01246149381
Version: webpack 2.3.3
Time: 8699ms
                                                              Asset       Size  Chunks                    Chunk Names
    ../css/assets/Roboto-Bold.dc81817def276b4f21395f7ea5e88dcd.woff    62.9 kB          [emitted]
     ../css/assets/Roboto-Bold.ecdd509cadbf1ea78b8d2e31ec52328c.eot      21 kB          [emitted]
   ../css/assets/Roboto-Medium.4d9f3f9e5195e7b074bb63ba4ce42208.eot    21.4 kB          [emitted]
  ../css/assets/Roboto-Regular.30799efa5bf74129468ad4e257551dc3.eot    21.3 kB          [emitted]
     ../css/assets/Roboto-Thin.dfe56a876d0282555d1e2458e278060f.eot    21.7 kB          [emitted]
    ../css/assets/default-skin.e3f799c6dec9af194c86decdf7392405.png  547 bytes          [emitted]
       ../css/assets/preloader.e34aafbb485a96eaf2a789b2bf3af6fe.gif  866 bytes          [emitted]
              ../css/assets/01.0a3750e6fdb29fcd632e627e2fc34dde.png  211 bytes          [emitted]
              ../css/assets/02.351bd6828f980ec53eb3a1ad0d3b1e31.png  213 bytes          [emitted]
              ../css/assets/03.e438ea2aabdb1087dc4f6fea5f6518e7.png  209 bytes          [emitted]
              ../css/assets/04.0284d042a6c29213aaa1979528195b7f.png  211 bytes          [emitted]
              ../css/assets/05.5014f9cce435c71ade6395a5ed0c50e7.png  213 bytes          [emitted]
              ../css/assets/06.21612b9d3e9d84e7e8761a2caf43bc65.png  211 bytes          [emitted]
              ../css/assets/07.f8da0281186df8f17f732a2a22aa0efa.png  215 bytes          [emitted]
              ../css/assets/08.975f7e0074400e7561ba2124604aacf2.png  146 bytes          [emitted]
              ../css/assets/09.fd19309a1932b475138799acc0b75a82.png  137 bytes          [emitted]
     ../css/assets/Roboto-Bold.e31fcf1885e371e19f5786c2bdfeae1b.ttf     128 kB          [emitted]
    ../css/assets/Roboto-Light.a990f611f2305dc12965f186c2ef2690.eot    20.9 kB          [emitted]
   ../css/assets/Roboto-Bold.39b2c3031be6b4ea96e2e3e95d307814.woff2      50 kB          [emitted]
    ../css/assets/Roboto-Light.46e48ce0628835f68a7369d0254e4283.ttf     127 kB          [emitted]
   ../css/assets/Roboto-Light.3b813c2ae0d04909a33a18d792912ee7.woff    62.3 kB          [emitted]
  ../css/assets/Roboto-Light.69f8a0617ac472f78e45841323a3df9e.woff2    49.4 kB          [emitted]
   ../css/assets/Roboto-Medium.894a2ede85a483bf9bedefd4db45cdb9.ttf     127 kB          [emitted]
  ../css/assets/Roboto-Medium.fc78759e93a6cac50458610e3d9d63a0.woff      63 kB          [emitted]
 ../css/assets/Roboto-Medium.574fd0b50367f886d359e8264938fc37.woff2    50.2 kB          [emitted]
  ../css/assets/Roboto-Regular.df7b648ce5356ea1ebce435b3459fd60.ttf     126 kB          [emitted]
 ../css/assets/Roboto-Regular.ba3dcd8903e3d0af5de7792777f8ae0d.woff    61.7 kB          [emitted]
../css/assets/Roboto-Regular.2751ee43015f9884c3642f103b7f70c9.woff2    49.2 kB          [emitted]
     ../css/assets/Roboto-Thin.94998475f6aea65f558494802416c1cf.ttf     128 kB          [emitted]
    ../css/assets/Roboto-Thin.7500519de3d82e33d1587f8042e2afcb.woff    61.6 kB          [emitted]
   ../css/assets/Roboto-Thin.954bbdeb86483e4ffea00c4591530ece.woff2    48.5 kB          [emitted]
    ../css/assets/default-skin.b257fa9c5ac8c515ac4d77a667ce2943.svg    1.55 kB          [emitted]
                                                             app.js    2.44 MB       0  [emitted]  [big]  app
                                                  ../css/styles.css     562 kB       0  [emitted]  [big]  app
   [0] ../~/webpack/buildin/global.js 509 bytes {0} [built]
   [1] ../~/process/browser.js 5.3 kB {0} [built]
   [2] ../~/webpack/buildin/module.js 517 bytes {0} [built]
   [3] ../~/bluebird/js/browser/bluebird.js 179 kB {0} [built]
   [4] ./client/css/_main.scss 41 bytes {0} [built]
   [5] ../~/lodash/lodash.js 540 kB {0} [built]
   [6] ./client/js/date_picker.js 1.21 kB {0} [built]
   [7] ./client/js/datepicker/bootstrap-datetimepicker.min.js 48.9 kB {0} [built]
   [8] ./client/js/video_progress.js 5.61 kB {0} [built]
  [10] ../~/moment/moment.js 129 kB {0} [built]
  [12] ../~/timers-browserify/main.js 1.36 kB {0} [built]
  [13] ./client/pack.js 6.7 kB {0} [built]
  [17] ../~/css-loader!../~/sass-loader/lib/loader.js!./client/css/_main.scss 583 kB [built]
  [32] ../~/style-loader/addStyles.js 6.91 kB [built]
  [54] ./client/img/svg/arrow_left.svg 333 bytes [built]
    + 41 hidden modules
Child extract-text-webpack-plugin:
       [2] ./client/font/roboto/Roboto-Medium.eot 110 bytes {0} [built]
       [3] ./client/font/roboto/Roboto-Regular.eot 111 bytes {0} [built]
       [4] ./client/font/roboto/Roboto-Thin.eot 108 bytes {0} [built]
       [5] ../~/css-loader/lib/css-base.js 2.19 kB {0} [built]
       [6] ./client/img/lightbox/default-skin.png 109 bytes {0} [built]
       [7] ./client/img/lightbox/preloader.gif 106 bytes {0} [built]
       [8] ./client/img/overlays/01.png 99 bytes {0} [built]
       [9] ./client/img/overlays/02.png 99 bytes {0} [built]
      [10] ./client/img/overlays/03.png 99 bytes {0} [built]
      [11] ./client/img/overlays/04.png 99 bytes {0} [built]
      [12] ./client/img/overlays/05.png 99 bytes {0} [built]
      [13] ./client/img/overlays/06.png 99 bytes {0} [built]
      [14] ./client/img/overlays/07.png 99 bytes {0} [built]
      [20] ./client/font/roboto/Roboto-Light.ttf 109 bytes {0} [built]
      [37] ../~/css-loader!../~/sass-loader/lib/loader.js!./client/css/_main.scss 583 kB {0} [built]
        + 26 hidden modules

Let me know if there is anything else I can provide.