Open atrout opened 1 year ago
Thanks a bunch for the issue @atrout, I've had a quick look and unfortunately it seems like Vercel creates a node function for the _error
instead of an edge one even if you correctly specify the runtime you want:
I'll open an issue there and try to see if there is a workaround we can adopt (but I am not sure if there is actually anything we can do about it on our side 😓)
Thanks for looking at this. We found a workaround using the <Sentry.ErrorBoundry>
component from the @sentry/react
library for client side errors.
I've created an issue in the Next repository: https://github.com/vercel/next.js/issues/48490
We'll have to see what they say, I tried thinking of something but I'm afraid that we can't do much about this on our side 😓
I've updated the issue title as it seems like this is actually an issue only with the Pages routing, within the App directory error pages seem to work fine 🙂 😅
Has anyone found a workaround for this issue yet? App router isn't an option for us since it doesn't play well with wagmi or trpc installs.
Trying to switch to cloudflare but this is a 100% blocker for us.
Is anyone also experiencing this issue with the app router? I don't actually have a custom error file (either error.tsx
or _error.tsx
) yet the same error messaging is still being displayed for me when I run the build script. Seems like others have only experienced this with the pages router, is there some configuration setting I need to change to adjust the build process for the app router? Thanks
@isaacholt100 sorry to hear you're having issue... this custom error issue is quite problematic 😓
do you have an _not-found
by any change?
Yes I do have a not-found.tsx
file at the top level of the app
folder. And I've removed it and now it's working - thanks for the suggestion!
No problem 🙂 (although it's not a great solution, we'll have to find something better 😓)
Hi @dario-piotrowicz, I had the same issue @isaacholt100 mentioned about _error and I confirm that removing not-found solved the problem, I don't how or why, but it does. Thanks!!
@requiemcreatif thanks for confirming that, yeah it's some weird Vercel behavior unfortunately 😓
I had the same issue @isaacholt100 mentioned about _error when declaring getInitialProps in _app.tsx. Does using getInitialProps in _app.tsx result in the internal generation of the _error page?
Let me know if there is a workaround in my case.
I am also forcing the same issue on pages router with _error.tsx and nextjs 13 :(
Hi @dario-piotrowicz, I had the same issue @isaacholt100 mentioned about _error and I confirm that removing not-found solved the problem, I don't how or why, but it does. Thanks!!
For me it fails the build even when no not-found.tsx
exists. It fails because the _not-found route is not configured to use the edge runtime. After creating the not-found.tsx it fails because the _error route does not use the edge runtime.
Maybe related to #413.
Thanks for looking at this. We found a workaround using the
<Sentry.ErrorBoundry>
component from the@sentry/react
library for client side errors.
How do you actually apply this fix? @atrout
Hello 👋🏽 I've added runtime config for the dynamic routes, and it worked even not-found.tsx
is still existing!
Added this export const runtime = 'edge';
for those pages;
src/pages/api/claps.ts
src/app/post/[slug]/page.tsx
src/app/bookmarks/[year]/page.tsx
Cli version
0.8.0
Next.js related information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Mon Dec 19 20:43:09 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T6000 Binaries: Node: 16.20.0 npm: 8.19.4 Yarn: N/A pnpm: 8.1.1 Relevant packages: next: 13.1.6 eslint-config-next: 13.1.6 react: 18.2.0 react-dom: 18.2.0 warn - Latest canary version not detected, detected: "13.1.6", newest: "13.3.1-canary.6". Please try the latest canary version (
npm install next@canary
) to confirm the issue still exists before creating a new issue. Read more - https://nextjs.org/docs/messages/opening-an-issueVercel version
28.18.3
Description
I'm getting an error from next-on-pages when it attempts to produce a Cloudflare Pages build:
This is the content of the _error.tsx page (it is taken directly from these instructions on how to configure Sentry with nextjs):
If I change the config to
export const config = { runtime: 'edge' };
I see the same error.Reproduction
No response
Additional Information
No response
Would you like to help?