Skip to content

Conversation

@JelmerBot
Copy link
Contributor

This PR solves #12200.

Assets emitted from a vite-plugin cannot be loaded by the pre-renderer's fetch implementation because they are not listed in the server manifest. This PR detects files the server's asset location (server/_app/immutable/assets) and add them the manifest's asset list:
https://github.com/JelmerBot/kit/blob/0fd65d309f029b36de41e28a3e8946d893e9385f/packages/kit/src/core/generate_manifest/index.js#L83C2-L90C3

The pre-renderer's read is updated to detect these asset links:
https://github.com/JelmerBot/kit/blob/0fd65d309f029b36de41e28a3e8946d893e9385f/packages/kit/src/core/postbuild/prerender.js#L214C5-L217C6

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2024

🦋 Changeset detected

Latest commit: 5dfed36

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@teemingc teemingc changed the title Detect build-emitted assets in prerenderer fetch fix: detect build-emitted assets in prerenderer fetch May 16, 2024
@svelte-docs-bot
Copy link

@JelmerBot JelmerBot force-pushed the dev/emitted-assets branch from ac3db20 to 6a8cd0e Compare March 24, 2025 11:05
Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

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

very late, but thank you!

@Rich-Harris Rich-Harris merged commit ece3906 into sveltejs:main Aug 12, 2025
34 of 35 checks passed
@github-actions github-actions bot mentioned this pull request Aug 11, 2025
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.

3 participants