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
/** @type {import('next').NextConfig} */
const nextConfig = {
env,
assetPrefix: isDev ? undefined : localEnv.PUBLIC_URL + baseUrl,
generateBuildId: async () => {
return process.env.CI_COMMIT_SHORT_SHA ?? null
},
crossOrigin: "anonymous",
rewrites: async () => {
return [
// for k8s readiness probe
{
source: "/hello",
destination: "/api/hello",
},
// for Prometheus Logging
{
source: "/metrics",
destination: "/api/metrics",
},
{
source: "/api/v1/:path*",
destination: "http://...", // Masked for security reasons
},
]
},
redirects: async () => {
// for old browser fallback redirect
return [
{
source: "/:path((?!old-browser-fallback.html).*)",
permanent: false,
has: [
{
type: "header",
key: "User-Agent",
value: "(.*Trident.*)",
},
],
destination: "/old-browser-fallback.html",
},
]
},
output: "standalone",
distDir: "build",
i18n: {
locales: ["default", "ko", "en", "ja", "jp"],
defaultLocale: "default",
localeDetection: false,
},
trailingSlash: true,
compiler: {
emotion: true,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "...", // Masked for security reasons
pathname: "/images/**",
},
],
},
webpack: (config) => {
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.(".svg"))
config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ["@svgr/webpack"],
}
)
// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i
return config
},
}
module.exports = withSentryConfig(withBundleAnalyzer(nextConfig), {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
org: process.env.NEXT_PUBLIC_SENTRY_ORG,
project: process.env.NEXT_PUBLIC_SENTRY_PROJECT,
// Only print logs for uploading source maps in CI
silent: !process.env.CI,
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: true,
},
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
authToken: process.env.SENTRY_AUTH_TOKEN,
release: {
create: true,
finalize: true,
name: process.env.RELEASE_VERSION,
setCommits: {
ignoreMissing: true,
auto: true,
},
},
})
Steps to Reproduce
When building the application for different platforms without the withSentryConfig, the resulting files' hash reflects the generateBuildID set in the next config options.
However, when adding Sentry and withSentryConfig, the hashes are no longer the same on different builds.
Expected Result
Different builds to have the same hash determined by the generateBuildID option:
Thanks for reporting. It would be interesting to see in what way the files' contents are different. Generally, the hashes are content-addressable so there must be something different. We need to figure out what exactly is different so that we can make that part of the output deterministic.
I can also reproduce this. I'm seeing different _sentryDebugIds and _sentryDebugIdIdentifier. This could be related to why I'm seeing this issue. Not seeing this in all chunks like OP, but only in some.
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.33.0
Framework Version
Next.js: ^14.0.4
Link to Sentry event
No response
Reproduction Example/SDK Setup
Next.config.js example:
Steps to Reproduce
When building the application for different platforms without the
withSentryConfig
, the resulting files' hash reflects thegenerateBuildID
set in the next config options.However, when adding Sentry and
withSentryConfig
, the hashes are no longer the same on different builds.Expected Result
Different builds to have the same hash determined by the generateBuildID option:
Actual Result
Different hashes:
The text was updated successfully, but these errors were encountered: