Title: Next.js Invalid left-hand side in assignment when using compile + generate build commands · Issue #16358 · getsentry/sentry-javascript · GitHub
Open Graph Title: Next.js Invalid left-hand side in assignment when using compile + generate build commands · Issue #16358 · getsentry/sentry-javascript
X Title: Next.js Invalid left-hand side in assignment when using compile + generate build commands · Issue #16358 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/16358
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Next.js Invalid left-hand side in assignment when using compile + generate build commands","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n9.22.0\n\n### Framework Version\n\n15.3.2\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nhttps://github.com/m-sanders/nextjs-sentry-asset-prefix\n\n### Steps to Reproduce\n\n1. Create a new Next.js app\n2. Use the Sentry Wizard.\n3. Add `assetPrefix` to `next.config.js`\n4. `npm run build -- --experimental-build-mode compile`\n5. `npm run build -- --experimental-build-mode generate`\n\nFurther information about the experimental mode can be found [here](https://nextjs.org/docs/pages/api-reference/cli/next#next-build-options) and [here](https://github.com/vercel/next.js/discussions/46544)\n\n### Expected Result\n\nA successful build (like with 14.2.2x).\n\nThe latest Next.js version that works with these steps is `15.2.5`. `15.3.0-canary-0` is the last good working release.\n\n### Actual Result\n\n```\n> next build --experimental-build-mode generate\n\n ▲ Next.js 15.3.2\n - Experiments (use with caution):\n · clientTraceMetadata\n\n Creating an optimized production build ...\n ✓ Collecting page data\n Inlining static env ...\nError occurred prerendering page \"/_not-found\". Read more: https://nextjs.org/docs/messages/prerender-error\n/Users/me/code/nextjs-sentry-asset-prefix/.next/server/chunks/575.js:172413\n \"/assets/\" = userNextConfig.assetPrefix;\n ^^^^^^^^^^\n\nSyntaxError: Invalid left-hand side in assignment\n at wrapSafe (node:internal/modules/cjs/loader:1486:18)\n at Module._compile (node:internal/modules/cjs/loader:1528:20)\n at Object..js (node:internal/modules/cjs/loader:1706:10)\n at Module.load (node:internal/modules/cjs/loader:1289:32)\n at Function._load (node:internal/modules/cjs/loader:1108:12)\n at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)\n at Module.\u003canonymous> (node:internal/modules/cjs/loader:1311:12)\n at mod.require (/Users/me/code/nextjs-sentry-asset-prefix/node_modules/next/dist/server/require-hook.js:65:28)\n at require (node:internal/modules/helpers:136:16)\nExport encountered an error on /_not-found/page: /_not-found, exiting the build.\n ⨯ Next.js build worker exited with code: 1 and signal: null\n```\n\n`15.3.0-canary-1` introduced this change https://github.com/vercel/next.js/pull/76990","author":{"url":"https://github.com/m-sanders","@type":"Person","name":"m-sanders"},"datePublished":"2025-05-21T20:14:19Z","url":"https://github.com/getsentry/sentry-javascript/issues/16358"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c5d0c045-71ad-4b40-a3ef-4d77b5ab5b92 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FA6:181F3D:56007:74A46:6B075598 |
| html-safe-nonce | e2fccfcab5b1bef719286bddf5bd13b746f344e660c7fec2359791f9dd96c4be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkE2OjE4MUYzRDo1NjAwNzo3NEE0Njo2QjA3NTU5OCIsInZpc2l0b3JfaWQiOiIzMTIzMjgyMjgzNjYzNDE0NjgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 567ae7fed8977aaf858bec9e084e4ecfd905ea5717da7e79b000f34f32fa3bc2 |
| hovercard-subject-tag | issue:3081309901 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/16358/issue_layout |
| twitter:image | https://opengraph.githubassets.com/66e3b048f4a1af91c9bad626310039d7b1ad1bde2494543a0736d18b8f37884e/getsentry/sentry-javascript/issues/16358 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/66e3b048f4a1af91c9bad626310039d7b1ad1bde2494543a0736d18b8f37884e/getsentry/sentry-javascript/issues/16358 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | m-sanders |
| hostname | github.com |
| expected-hostname | github.com |
| None | 663b1a69a41309856ffd9403fa5b764f6c0f78a39a0a8f75fb2c205c96a947be |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | effa2c0a160a75bd95d9ffcc6320197d7aea0d83 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width