diff --git a/.changeset/fast-boxes-perform.md b/.changeset/fast-boxes-perform.md new file mode 100644 index 000000000000..00643b82bed2 --- /dev/null +++ b/.changeset/fast-boxes-perform.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: include base path in path to start script diff --git a/packages/kit/src/runtime/server/page/render.js b/packages/kit/src/runtime/server/page/render.js index 9c911ebb147b..215ca2b3fef6 100644 --- a/packages/kit/src/runtime/server/page/render.js +++ b/packages/kit/src/runtime/server/page/render.js @@ -164,7 +164,15 @@ export async function render_response({ } /** @param {string} path */ - const prefixed = (path) => (path.startsWith('/') ? path : `${resolved_assets}/${path}`); + const prefixed = (path) => { + if (path.startsWith('/')) { + // Vite makes the start script available through the base path and without it. + // We load it via the base path in order to support remote IDE environments which proxy + // all URLs under the base path during development. + return base + path; + } + return `${resolved_assets}/${path}`; + }; const serialized = { data: '', form: 'null', error: 'null' }; diff --git a/turbo.json b/turbo.json index e07e1e8cf14a..7a422b757850 100644 --- a/turbo.json +++ b/turbo.json @@ -44,7 +44,7 @@ }, "test": { "dependsOn": ["^build"], - "inputs": ["test/**"], + "inputs": ["src/**", "scripts/**", "shared/**", "templates/**", "test/**"], "outputs": ["coverage/", "test-results/**"], "outputMode": "new-only", "env": ["CI", "TURBO_CACHE_KEY"]