jquery / jquery/jquery-ui

Url loader with JQuery UI Error - resolve-url-loader: CSS error Invalid mapping

Open
#2,016 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Behavior shared with 1.12
Dominant language
JavaScript
Stars
11.3k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

I am having some issues with my project when trying to import JQuery UI css files. I have added the following to my projects' App.scss file.

@import url("../node_modules/jquery-ui/themes/base/all.css");

When I try to build my web application (react/typescript) I get the following error.

> ./src/App.scss Error: resolve-url-loader: CSS error   Invalid mapping:
> {"generated":{"line":10,"column":538},"source":"file://C:\\Jenkins\\workspace\\MyWebApp\\node_modules\\jquery-ui\\themes\\base\\base.css","original":{"column":null},"name":null}

Whats strange is when I open look in base.css which is the file the error is being thrown I can see that there are additional imports all being imported with the format - @import url("file.css")

When I adjust the imports in base.css to the format - @import "file.css" then the application builds successfully.

Can anyone explain why this is happening or how to fix this without modifying the package directly? I am not that familiar with resolve-url-loader

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the build from src/App.scss with jquery-ui/themes/base/all.css and the reported resolve-url-loader error. Inspect the nested imports in base.css and how resolve-url-loader handles their source mappings. Done means identifying a reproducible cause and a workaround that builds without modifying the installed package.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.