You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Resolve the URL of an asset in your `static` directory, by prefixing it with [`config.kit.paths.assets`](https://svelte.dev/docs/kit/configuration#paths) if configured, or otherwise by prefixing it with the base path.
The `transform` hook in `plugin_remote` (`src/exports/vite/index.js`) modifies `.remote.*` files but doesn't return a `map` property in either code path. This causes:
4
+
5
+
1.**Vite build warnings:**`[plugin vite-plugin-sveltekit-remote] Sourcemap is likely to be incorrect` — once per `.remote.*` file, for both SSR and client builds.
6
+
2.**Broken sourcemaps:** The resulting `.js.map` files have `sources: []`, `sourcesContent: []`, and semicolon-only `mappings`. Error monitoring tools (e.g. Sentry) cannot map stack traces back to the original source.
7
+
8
+
Per the [Vite Plugin API docs](https://vite.dev/guide/api-plugin.html#transforming-custom-file-types), `transform` hooks should return `{ code, map }`.
9
+
10
+
Closes #15472
11
+
12
+
### Changes
13
+
14
+
**SSR path (~line 727):** Uses `MagicString` (already a dependency) instead of string concatenation, returns `{ code, map }` with a proper sourcemap via `ms.generateMap({ hires: true })`.
15
+
16
+
**Client path (~line 803):** Adds `map: { mappings: '' }` to signal intentional full module replacement (the generated proxy code doesn't need source mapping back).
17
+
18
+
### Testing
19
+
20
+
Reproduction repo with `build:bug` / `build:fix` scripts: https://github.com/DJMogens/sveltejs-kit-sourcemap-bug
0 commit comments