Skip to content

fix(manifest): use resolved virtual module ID for CSS imports in Vite 8 - #2293

Open
waterWang wants to merge 1 commit into
solidjs:mainfrom
waterWang:fix/vite-8-virtual-css-module-resolution
Open

fix(manifest): use resolved virtual module ID for CSS imports in Vite 8#2293
waterWang wants to merge 1 commit into
solidjs:mainfrom
waterWang:fix/vite-8-virtual-css-module-resolution

Conversation

@waterWang

Copy link
Copy Markdown

Description

Virtual CSS modules (e.g. UnoCSS /__uno.css) have dep.file === null and dep.id starting with \0. Using dep.url (e.g. /__uno.css) in the generated import() call fails in Vite 8 module runner with ERR_DENIED_ID because the URL looks like a nonexistent filesystem path.

Root Cause

In findStylesInModuleGraph, the code stores styles[dep.id] = dep.url for all CSS modules. For virtual modules:

  • dep.url = /__uno.css (the URL form, not resolvable as a real file)
  • dep.id = \0virtual:uno.css (the resolved virtual module ID)

The generated code does import("/__uno.css?inline") — Vite 8's module runner rejects this ID because it's neither a real file path nor a \0-prefixed virtual module.

Fix

For virtual modules (dep.file === null), use dep.id (the resolved ID) instead of dep.url. wrapId() converts \0virtual:uno.css to /@id/__x00__virtual:uno.css — a safe form that Vite's /@id/ resolution plugin can resolve through the plugin pipeline.

Real CSS files (dep.file is set) keep using dep.url as before.

Related

Fixes #2292

Virtual CSS modules (e.g. UnoCSS /__uno.css) have dep.file === null and
dep.id starting with \0. Using dep.url (e.g. "/__uno.css") in the generated
import() fails in Vite 8 module runner with ERR_DENIED_ID because the URL
looks like a nonexistent filesystem path.

Fix: use dep.id (the resolved virtual module ID, e.g. \0virtual:uno.css)
for virtual modules. wrapId() converts it to /@id/__x00__virtual:uno.css,
a safe form that Vite's /@id/ resolution plugin can resolve through the
plugin pipeline. Real CSS files (dep.file is set) keep using dep.url.

Fixes solidjs#2292
@changeset-bot

changeset-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5d74ef5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit 5d74ef5
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a81c8df124b140008cd194c
😎 Deploy Preview https://deploy-preview-2293--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2293

commit: 5d74ef5

@brenelz

brenelz commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@katywings thoughts on this?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: Vite 8 rejects UnoCSS virtual CSS request in SolidStart dev SSR

2 participants