fix: skip prebundling of .remote.js files - #14583
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 59bf38a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Member
Author
|
(this will probably need a Rolldown equivalent eventually) |
dummdidumm
approved these changes
Oct 2, 2025
dummdidumm
left a comment
Member
There was a problem hiding this comment.
good apart from a small regex tweak
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Copilot AI
pushed a commit
to Stadly/kit
that referenced
this pull request
Mar 6, 2026
* fix: skip prebundling of .remote.js files * robustify * Update packages/kit/src/exports/vite/index.js Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Rich-Harris
pushed a commit
that referenced
this pull request
Jul 20, 2026
…kages can re-export remote functions (#16426) Fixes #16353. #14583 stops dependency tracing at `.remote.*` files by loading them as empty modules during prebundling, so their server-only imports stay out of the client bundle. An empty module also has no exports, so a package entry that re-exports from a remote file kills the dev server during dependency optimization ``` [MISSING_EXPORT] "lib_echo" is not exported by ".../data.remote.js" 1 │ export { lib_echo } from './data.remote.js'; ``` The docs say third party libraries can provide remote functions, so this should work without per-package `optimizeDeps` config. Externalizing the resolved id instead keeps tracing stopped and the export surface intact, and the dev server serves the real module through the normal transform. Build mode never ran the optimizer and stays green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes at least part of #14519 — I couldn't get the repro to start up, because Vite's
optimizeDepsstep prebundles any dependencies it finds from+page.svelteand+page.jsentry points. Import tracing should stop at.remote.jsfiles, because these don't run in the client. This PR makes it so.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits