webpack-contrib / stylus-loader

:art: A stylus loader for webpack.
MIT License
498 stars 99 forks source link

Regression when using hashbangs in URLs #294

Closed qraynaud closed 4 years ago

qraynaud commented 4 years ago

Expected Behavior

I'm using the following font-face in my project:

@font-face
  font-family 'Lato'
  src url('../fonts/Lato-Regular.eot')
  src url('../fonts/Lato-Regular.eot?#iefix') format('embedded-opentype'),
      url('../fonts/Lato-Regular.woff2') format('woff2'),
      url('../fonts/Lato-Regular.woff') format('woff'),
      url('../fonts/Lato-Regular.ttf') format('truetype'),
      url('../fonts/Lato-Regular.svg#Lato-Regular') format('svg')
  font-weight 400
  font-style normal
  text-rendering optimizeLegibility

When using stylus-loader version 3.0.2 this works properly.

Actual Behavior

With version 4.1.1 I get the following error message:

ERROR in ./client/styles/app.styl
    Module build failed (from ./node_modules/css-loader/dist/cjs.js):
    Error: Can't resolve 'fonts/Lato-Regular.svg#Lato-Regular' in […]

It seems to me that the loader fails to remove the hashbang in the url before trying to load the module.

cap-Bernardito commented 4 years ago

Please update сss-loader to the latest version. If that doesn't help, please provide a minimally reproducible test repository. Then I will reopen this issue.