CSS URL resolution issue when using 'asset' rule type.
The issue involves incorrect CSS URL resolution when using the 'asset' rule type in Next.js, specifically affecting SVG files. The problem is reproducible and has a clear expected behavior, but the fix may require understanding Next.js's CSS and asset handling mechanisms. No maintainer feedback is available yet.
npm installnpm run dev// app/style.css
.bg{
// should correct load image
background: url("./img.svg");
}
.bg {
background: url("../media/img.8569dc29.svg");
}
.bg {
background: url("./img.svg");
}
without rule for svg it works correct
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023
Available memory (MB): 4102
Available CPU cores: 2
Binaries:
Node: 20.12.1
npm: 10.5.0
Yarn: 1.22.19
pnpm: 8.15.6
Relevant Packages:
next: 16.2.0-canary.35 // Latest available version is detected (16.2.0-canary.35).
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: 5.9.3
Next.js Config:
output: N/A
CSS
next dev (local)
Related PR https://github.com/vercel/next.js/pull/88788
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!