Tracking: Vite doesn't resolve `#lib` in CSS `url()` (blocks `#lib` in `<style>` tags)
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript, vite
Research direction
Read packages/sv/src/migrate/migrations/sveltekit-3/tasks/lib-alias.ts and the linked Vite issue first; this follow-up is blocked until Vite supports subpath imports in CSS url(). Once that support ships, inspect the migration tests and verify that #lib paths inside <style> tags are handled consistently with other paths.
Written by the indexing model from the issue text.
Description
When Vite supports subpath imports in CSS url(), we should revisit the workaround from the Kit 3 migration.
Context
- Root cause is upstream: vitejs/vite#16155 — Vite does not resolve
#-prefixed subpath imports (e.g.#lib/...) in CSSurl(). It is approved, labeledp3-downstream-blocker, and on the Vite 8.4 milestone. - This first surfaced in #1267: the migration's
$lib→#libchange brokeurl("$lib/...")inside<style>tags. - Workaround (PR #1266): inside
<style>tags,lib-alias.tsrewrites$libto a relative path instead of#lib.
Impact
- Path shape is inconsistent:
#lib/...everywhere else, relative path inside<style>tags. - Users who hand-write
url("#lib/...")are still broken until Vite fixes it.
Follow-up (once Vite 8.4 ships support)
- Revisit
lib-alias.tsand consider emitting#libinside<style>tags so usage is consistent.
(The back-references use full GitHub issue shorthand so they resolve when posted via gh.)
- Dominant language
- TypeScript
- Stars
- 513
- Forks
- 110
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sveltejs/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 4 days
-
[bug] Better Auth addon generates legacy D1 binding access with SvelteKit 3 and Cloudflare adapter 8Openbug pkg:add
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sveltejs/cli#1450 · 2 comments ·
Maintainers usually reply within 4 days
-
pkg:add
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
sveltejs/cli#1404 · 1 comment ·
Maintainers usually reply within 4 days
-
pkg:add
Difficulty 1/5 Under an hour Newbie friendliness 78/100
sveltejs/cli#1399 · 2 comments ·
Maintainers usually reply within 4 days
-
enhancement pkg:migrate
Difficulty 3/5 1-2 days Newbie friendliness 53/100
sveltejs/cli#1440 · 3 comments · 1 reaction ·
Maintainers usually reply within 4 days
Similar issues
-
[analytics-core] getQueryParams does not decode `+` as space and truncates values containing `=`Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
amplitude/Amplitude-TypeScript#2179 · 1 comment ·
Maintainers usually reply within 2 days
-
ci good first issue severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
TMHSDigital/GH-Arcade#111 ·
-
AsnIntegerConverter.toASN coerces strings with +value, rounding integers outside safe-integer rangeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PeculiarVentures/asn1-schema#189 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anaisbetts/spawn-rx#38 ·