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
Because adapter-node transpiles the original source the error stacks you see in production aren't always that useful in tracking down an issue. I thought it might be as simple as adding source maps to the esbuild config:
esbuild: function (config) {
config.sourcemap = 'inline';
return config;
}
which sort of works, but now the source lines it gives me are in .svelte-kit/build/app.js. If I add:
build: {
sourcemap: 'inline'
}
to Sveltekit's vite config then .svelte-kit/build/app.jsdoes have source maps but esbuild doesn't merge source maps. I've played a little with the merge-source-maps module but it definitely isn't working with SvelteKit out of the box.
Describe the proposed solution
I'm not entirely sure what the answer is here but wanted to flag it as a desired feature. I'm happy to dig further into it myself but might benefit from the wisdom of someone more familiar with SvelteKit's internals. merge-module-maps fails because it tries to load ${PROJECT_DIR}/kit/dist/node.js which is presumably @svelte/kit/dist/node.js but I'm not totally sure where that's being imported.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered:
The easy solution would probably be to make esbuild bundling optional. It was only added in #1648, so shouldn't be required since we always got away without doing it before.
The better solution is probably to see if we can make Vite responsible for all bundling. The adapter could just be a library and SvelteKit could do all the building instead of the adapter being in charge of the build process. SvelteKit could specify the adapter entry point as the entry point in the Vite build config. It would depend on removing the relative path to the application file #2285 (comment)
I'd hesitate to say we got away without doing it before that PR. @sveltejs/kit was previously a production dependency of all apps using SvelteKit and the Node adapter, which is pretty bad.
Describe the problem
Because adapter-node transpiles the original source the error stacks you see in production aren't always that useful in tracking down an issue. I thought it might be as simple as adding source maps to the esbuild config:
which sort of works, but now the source lines it gives me are in
.svelte-kit/build/app.js
. If I add:to Sveltekit's vite config then
.svelte-kit/build/app.js
does have source maps but esbuild doesn't merge source maps. I've played a little with the merge-source-maps module but it definitely isn't working with SvelteKit out of the box.Describe the proposed solution
I'm not entirely sure what the answer is here but wanted to flag it as a desired feature. I'm happy to dig further into it myself but might benefit from the wisdom of someone more familiar with SvelteKit's internals. merge-module-maps fails because it tries to load
${PROJECT_DIR}/kit/dist/node.js
which is presumably@svelte/kit/dist/node.js
but I'm not totally sure where that's being imported.Alternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: