Skip to content

fix(core): reload CSS#15259

Merged
ematipico merged 2 commits into
nextfrom
fix/dev-css-reload
Jan 21, 2026
Merged

fix(core): reload CSS#15259
ematipico merged 2 commits into
nextfrom
fix/dev-css-reload

Conversation

@ematipico

Copy link
Copy Markdown
Member

Changes

Closes #15194

The code was trying to run runner.import using the wrong vite environment. runner.import doesn't function when the environment is non-runnable. SSR is non-runnable when using the cloudflare vite plugin

Testing

Manually tested.

CI should stay green

Docs

N/A

@ematipico ematipico marked this pull request as ready for review January 20, 2026 14:19
@changeset-bot

changeset-bot Bot commented Jan 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cdcb076

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Jan 20, 2026
@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

⚠️ Package Trust Level Decreased

Caution

Decreased trust levels may indicate a higher risk of supply chain attacks. Please review these changes carefully.

📦 Package 🔒 Before 🔓 After
@cloudflare/kv-asset-handler trusted-with-provenance none
@cloudflare/unenv-preset trusted-with-provenance none
workerd trusted-with-provenance none
miniflare trusted-with-provenance none
youch provenance none
@cloudflare/workerd-darwin-64 trusted-with-provenance none
@cloudflare/workerd-darwin-arm64 trusted-with-provenance none
@cloudflare/workerd-linux-64 trusted-with-provenance none
@cloudflare/workerd-linux-arm64 trusted-with-provenance none
@cloudflare/workerd-windows-64 trusted-with-provenance none
wrangler trusted-with-provenance none

@matthewp

Copy link
Copy Markdown
Contributor

The failing test here might be wrong, we might have been omiting those styles previously when we shouldn't have.

await environment?.runner?.import(componentPageId);
const resolved = await environment?.pluginContainer.resolveId(componentPageId);
if (ssrEnvironment && isRunnableDevEnvironment(ssrEnvironment)) {
await ssrEnvironment.runner?.import(componentPageId);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will never run on CF. Isn't it an issue?

@ematipico ematipico Jan 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's the constraint of the CF environment. There isn't much we can do. We can't leverage caching.

I tried using the astro environment, but it has a bigger impact and requires many changes

@ematipico ematipico merged commit 8670a69 into next Jan 21, 2026
22 checks passed
@ematipico ematipico deleted the fix/dev-css-reload branch January 21, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants