-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry starts sourcemap uploads before NextJS build is finished #13533
Comments
Hi, something feels off. Sentry does upload your source maps 2-3 times during the build. Once for the server, once for the client, and maybe once for the edge runtime code. This means that it is perfectly normal to see upload logs in the middle of your build. Can you share a Sentry event where source mapping didn't work and also your |
Hi @lforst , thank you for the quick reply. How would you like me to share the Sentry event? Is there any particular export/screenshot I can get for you? This is my
This is the other tab in tracking the sourcemaps on Sentry: |
@jrandeniya Simply sharing a link to the event here would be fine! Side-note: I recommend not mutating the |
Oh nevermind, I just spotted somthing that is very much critical. Can you try throwing a different error than a Syntax Error? |
Hi @lforst , This was a type-error that happened somewhere in the code ( When I explicitly throw an error, then it works well (Event ID: ba049c2284274c1d95e3f5a7f75663f2): |
I have also updated my
|
@lforst I'm not sure what's changed... I haven't changed anything actually but looks like its coming through now. It was the same config as before when I got the |
Cool! It sometimes takes us a while to process your sourcemaps before we can use them to unminify your errors. We might have run into that. |
Thanks @lforst I'll keep an eye on it. So after each deployment, it might take some for errors to get the stack trace? |
@jrandeniya no, once an error has been ingested by Sentry, it either has one or it doesn't. There is no retroactive sourcemapping. It just may take a while (max few minutes) after you do a release that Sentry has processed your sourcemaps to apply those sourcemaps to your incoming errors. |
Hi @jrandeniya. Do you still get debug messages like 'Could not determine source map path for bundle:' or ' Could not determine debug ID from bundle..' at build time? I'm experiencing the same issue on Vercel. |
I have exactly same issue on Vercel @lforst import withBundleAnalyzer from "@next/bundle-analyzer"
import {withSentryConfig} from "@sentry/nextjs"
import createJiti from "jiti"
import {fileURLToPath} from "node:url"
const jiti = createJiti(fileURLToPath(import.meta.url))
const withVercelToolbar = (
await import("@vercel/toolbar/plugins/next")
).default()
jiti("./lib/env")
const nextConfig = {
reactStrictMode: true,
experimental: {
ppr: "incremental",
// reactCompiler: true,
staleTimes: {
dynamic: 30,
},
serverActions: {
bodySizeLimit: "512mb",
},
},
logging: {
fetches: {
fullUrl: true,
},
},
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
skipTrailingSlashRedirect: true,
}
const bundleAnalyzerConfig = {
enabled: process.env.ANALYZE === "true",
}
const sentryConfig = {
automaticVercelMonitors: true,
disableLogger: true,
hideSourceMaps: true,
org: "",
project: "",
reactComponentAnnotation: {
enabled: true,
},
silent: !process.env.CI,
tunnelRoute: "/monitoring",
widenClientFileUpload: true,
}
const headers = async () => [
{
headers: [
{
key: "Document-Policy",
value: "js-profiling",
},
],
source: "/:path*",
},
]
const composedConfig = withBundleAnalyzer(bundleAnalyzerConfig)(
withSentryConfig(withVercelToolbar(nextConfig), {
...sentryConfig,
telemetry: false,
headers,
}),
)
export default composedConfig |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.27.0
Framework Version
Next 14.2.7, React 18.3.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
The
@sentry/nextjs
plugin seems to be upload the sourcemaps before the build finishes, therefore sourcemaps are missing:Then after heaps of upload logs as above (see timestamps) then Vercel prints:
Steps to Reproduce
Ran the
npx @sentry/wizard@latest -i nextjs
with the recommended configuration for each step and updated some basic config:Expected Result
Sourcemaps to be uploaded after the NextJS build is complete.
Actual Result
Sourcemaps are uploaded while the build is still in progress and in Sentry, errors do not have sourcemaps:
The text was updated successfully, but these errors were encountered: