[Feature Request] - Server Side Sourcemaps (production) for Node Stacktraces #20096
Replies: 9 comments 7 replies
-
@timneutkens is there any reason why we wouldn't want this? It seems like an easy addition and can be off by default. Its a shame some of us cant make use of Node's Something like the following would be useful module.exports = {
experimental: {
productionServerSourceMaps: true
}
} |
Beta Was this translation helpful? Give feedback.
-
Any updates on this @leerob @timneutkens ? |
Beta Was this translation helpful? Give feedback.
-
A feature that I would like is a way to easy create source maps for production. I know that already exists with A proposal would be to have something like this. This isn't a silver bullet if you put your content on a separate server but if the Next.js app is serving the static files. type MaybePromise<T> = T | Promise<T>;
type ExposePublic = 'public';
type ExposeRequest = (req: Request) => MaybePromise<boolean>;
type ExposeHeaders = {
type: 'cookie' | 'headers' | 'basic-auth',
name?: string,
match: string | (value: string) => MaybePromise<boolean>
};
type ProposalNextConfig = NextConfig & {
sourceMaps: {
production: boolean;
exposeStrategy:
ExposePublic |
ExposeRequest |
ExposeHeaders;
}
}; |
Beta Was this translation helpful? Give feedback.
-
It seems this would resolve the issue of debugging server-side functions, right? |
Beta Was this translation helpful? Give feedback.
-
Does anyone have experience with https://www.highlight.io/blog/lw5-next-js-server-sourcemaps ? It claims to show a way to enable source maps on the server… |
Beta Was this translation helpful? Give feedback.
-
So apparently we still don't have any way to have sourcemaps in production right? |
Beta Was this translation helpful? Give feedback.
-
Run the server as |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Update on this: This is the default with Turbopack builds. We've been able to implement sourcemaps in a way that does not have a negative effect on performance and memory usage. Currently available in alpha: https://nextjs.org/blog/next-15-3#turbopack-builds-alpha |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
NodeJS can now parse sourcemaps (for better stack traces) in v12.20.0 onwards. So it would be nice to use this feature (link below).
#13018 looks like it added support but just for the browser side? Does this generate sourcemaps for the server side too?
If not then this issue is a request for that.
Beta Was this translation helpful? Give feedback.
All reactions