Skip to content
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

[🐛 Bug]: failure build after adding not-found.js with edge runtime #288

Closed
1 task
anonymouscatcher opened this issue May 31, 2023 · 4 comments
Closed
1 task
Labels
app router This issue is related to the App router bug Something isn't working

Comments

@anonymouscatcher
Copy link

next-on-pages environment related information

System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.5.0
Binaries:
Node: 18.16.0
Yarn: 1.22.10
npm: 9.5.1
pnpm: N/A
Package Manager Used: yarn (classic)
Relevant Packages:
@cloudflare/next-on-pages: 0.10.1
vercel: N/A
next: 13.4.2

Description

import dynamic from 'next/dynamic';

export const runtime = 'edge';

export default function NotFound() {
  return <div>Not found page...</div>;
}

error:

⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project.
⚡️
⚡️ 	The following functions were not configured to run with the Edge Runtime:
⚡️ 		- _error.func

Reproduction

No response

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

No response

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@anonymouscatcher anonymouscatcher added the bug Something isn't working label May 31, 2023
@james-elicx
Copy link
Contributor

Hey there, please could you try removing the edge runtime opt-in for your not-found.js file?

Error pages have notoriously been rather problematic with the edge runtime with Next.js. In the pages directory, they didn't really work. In the app directory, there is some odd behaviour.

In this case, I just tried building a project with a root-level not-found.tsx file and it errored when I opted it into the edge runtime. However, when I removed the edge runtime export from the file, it succeeded because it was statically generated. 🙂

@matamatanot
Copy link

vercel/next.js#54199

Adding a default app router not-found error page in production. We introduced a custom global not-found page if you have not-found.js file under app directory.

@anonymouscatcher
Copy link
Author

@james-elicx it doesn't work for me, with/without edge runtime, have you checked it recently?

@dario-piotrowicz
Copy link
Member

dario-piotrowicz commented Dec 5, 2023

I'm closing this issue as it seems like everything here is also included in #413, and all conversations seem to be happening there at this point, so I don't think there is too much point in keeping this issue open and we should just use #413

@anonymouscatcher I hope this is fine, please let me know if you disagree and we can reopen this one 🙂🙏

@dario-piotrowicz dario-piotrowicz closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app router This issue is related to the App router bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants