Skip to content

Spaces around unquoted CSS url() values are not consistent #781

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

Closed
webpack-bot opened this issue Oct 8, 2018 · 0 comments
Closed

Spaces around unquoted CSS url() values are not consistent #781

webpack-bot opened this issue Oct 8, 2018 · 0 comments

Comments

@webpack-bot
Copy link

Bug report

What is the current behavior?

Un-quoted CSS url() values are not consistent in their handling of trailing spaces. For example,

background-image: url(Truchet_tiling_inverse.png);

works where

background-image: url(Truchet_tiling_inverse.png );

does not (note the trailing space character). The latter results in:

This relative module was not found:
* ./Truchet_tiling_inverse.png in ./node_modules/css-loader??ref--1-2!./test.css

If the URL value is quoted, the problem does not occur. I assume it's expecting the filename to also have a space character at the end (i.e. .png ).

The problem does also not occur if there's a leading space, i.e. this is fine:

background-image: url( Truchet_tiling_inverse.png);

If the current behavior is a bug, please provide the steps to reproduce.

I have made a minimal example. To replicate:

git clone https://github.com/samwilson/webpack-issue
cd webpack-issue
npm install
./node_modules/.bin/encore production

What is the expected behavior?

The URL with a space after it should work equivalently to one without a space, as it does in web browsers etc.

Other relevant information:
webpack version: 3.8.14
Node.js version: v8.10.0
Operating System: Linux
Additional tools: Encore 0.20.1


This issue was moved from webpack/webpack#8155 by @evilebottnawi. Original issue was by @samwilson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants