Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

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

Closed

Description

@webpack-bot

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.

Activity

  1. added 2 commits that reference this issue on Oct 10, 2018
    a57f8ab
    b619d0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions