-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Next 13 + App Router + static export results in a build error (Specified "rewrites" cannot be used with "output: export") #8285
Comments
Hey Can you please try the below changes and updates Option 1:Use "target: serverless" instead of "output: export"
or
Option 2:Update Sentry SDK version
|
No go:
|
Hi @metalmarker, please ignore @alikazi88's responses. It looks like they copied & pasted this issue into something like chat GPT and their answer is straight-up wrong and not helpful. Can you please share your |
@lforst - thanks for the quick reply. The tunnelRoute was indeed set (it was added by the Next configuration wizard) and upon removal I was able to build the static code without that error. After generating the static export, I served it from my local machine. Now, however, I see no source code at all when triggering an error. I verified that the source maps for the last build were added under the project (under "Release bundles", not Artifact bundles). Here is my
|
Hey, I recommend turning off the |
I've turned |
Can you share a link to the event that doesn't have a stacktrace? Thanks. |
Here are two errors, one in local "production" and one in development mode, triggered by the same code: This error was generated by a static export that I’m serving from my local machine. Source code is not displayed. This error was generated when I run Next in development mode. Source code is displayed, but there’s an error: “We've encountered 1 problem un-minifying your applications source code / Invalid absolute path URL. |
@metalmarker since you're doing an export and likely serving stuff from a different path than when just doing https://www.npmjs.com/package/@sentry/webpack-plugin/v/1.20.1 |
@lforst, I've invested several hours in trying to crack this, but was unsuccessful so far. |
@lforst, bumping this up... surely this is something that others would encounter on similar configuration |
this solved the problem for me as well. The |
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
7.54.0
Framework Version
Next 13.4.4
Link to Sentry event
No response
SDK Setup
I've used the wizard to create the sentry.*.config.js files. My next.config.js is:
{ images: { unoptimized: true }, experimental: { externalDir: true }, output: 'export', reactStrictMode: true }
Steps to Reproduce
I'm using the Next with the App Router in a static configuration (
output: 'export'
in next.config.js).When attempting to build the app, I'm getting:
> Build error occurred Error: Specified "rewrites" cannot be used with "output: export". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes at assignDefaults (/Users/eran/Dev/Butterfly/Website/node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/config.js:218:19) at loadConfig (/Users/eran/Dev/Butterfly/Website/node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/config.js:550:32) at async Span.traceAsyncFn (/Users/eran/Dev/Butterfly/Website/node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/trace/trace.js:103:20) at async /Users/eran/Dev/Butterfly/Website/node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/index.js:150:28 at async Span.traceAsyncFn (/Users/eran/Dev/Butterfly/Website/node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/trace/trace.js:103:20) at async build (/Users/eran/Dev/Butterfly/Website/node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/index.js:145:29)
This error started following the integration of the Sentry SDK. This error is suppressed when I remove the
output: 'export'
option.Expected Result
No errors when building a static website.
Actual Result
N/A
The text was updated successfully, but these errors were encountered: