-
Notifications
You must be signed in to change notification settings - Fork 130
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]: Not-found page doesn't work with last vercel version v31.2.0 in edge runtime #413
Comments
Yes. I have the same problem. |
Hi @AlexandrNetsvetov thank you very much for the issue 🙂 The second part of the issue is a duplicate of #288 The first could be a very similar issue, it's interesting that it worked on an older Vercel CLI but not on a new one, I'll investigate it if you could share your code that'd be very helpful 🙏 , if that's not possible, anyways I'd just like to double-check, am I correct in thinking that you're using app directory? (as in pages you'd have PS: @Blackberry009, you as well, if you can share your code that could be very helpful 🙂 🙏 (if you experienced the first part of the issue this is the right place, if you experienced the second part please share info in #288) |
@dario-piotrowicz Thanks for your answer. Yes, I'm using app directory. I can't share my code but I'm ready to provide you all details that you need. PS: I've added |
Thanks a lot for the info @AlexandrNetsvetov 😄 I'll investigate and if more info is needed I'll let you know 🙂 🙏 |
My app throws the same error. Next v13.4.13 |
I've just merged #418 which introduces a temporary workaround for this issue, it allows the use of a not-found page as long as it doesn't contain runtime logic It is not ideal but the best we can do for now, I've marked this issue as |
I've tried that solution, but the issue still occurs @dario-piotrowicz. {
"devDependencies": {
"@cloudflare/next-on-pages": "https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/5786546906/npm-package-next-on-pages-418",
}
} Build logs in no edge runtime: 22:21:28.531 | ⚡️The following routes were not configured to run with the Edge Runtime:
22:21:28.531 | ⚡️ - /_not-found
22:21:28.531 | ⚡️
22:21:28.532 | ⚡️Please make sure that all your non-static routes export the following edge runtime route segment config:
22:21:28.532 | ⚡️ export const runtime = 'edge'; Build logs in edge runtime: 22:24:11.400 | ⚡️The following routes were not configured to run with the Edge Runtime:
22:24:11.401 | ⚡️ - /_error
22:24:11.401 | ⚡️
22:24:11.401 | ⚡️Please make sure that all your non-static routes export the following edge runtime route segment config:
22:24:11.401 | ⚡️ export const runtime = 'edge'; |
@emrecoban are you sure the prerelease got installed correctly? 😓 can you double check and make sure that next-on-pages tells you that it's using the prerelease version? I just used the prerelease to deploy this application which is getting built correctly and working as expected: (If you confirm that you're indeed using the prerelease, can you spot something different between your application and mine that could make yours not work?) |
Finally I'm here. Okay, I updated next-on-pages, and then it worked. But I had to add [email protected] package, or something (I'm not sure). Because I couldn't update the package for a while as follow (The message I gave up to send).
_ Okay, another issue is related to my app, anyway. Thanks a lot! @dario-piotrowicz |
@emrecoban awesome! no problem! thanks so much for confirming that's all good now (or at least as good as it can be given our limitations 😅) ❤️ |
same error, so annoying. remix just worked out of the box. I will side with joe armstrong the creator of erlang here RIP, when he said NPM and the node ecosystem is simply wack, taking something that should be smoothly and easily and adding a layer of 3 PhDs required just to deploy a project. |
added like so
|
Does anyone know how to force next-on-pages to be commit or branch bound?
even with this line in package.json it still pulls wrong version
|
I did
I dont get why this keeps happening in the cloudflare pipeline
|
@vans163 I've checked my app's build logs, and then seen the same warn. You can ignore it. Just check the 01:35:41.009 | devDependencies:
01:35:41.009 | + @cloudflare/next-on-pages 0.0.0-54d6325
01:35:41.010 | + @tailwindcss/forms 0.5.4
01:35:41.010 | + vercel 30.0.0
01:35:41.010 |
01:35:41.010 | Done in 29.2s
01:35:41.050 | Executing user command: npx @cloudflare/next-on-pages@1
01:35:47.290 | npm WARN exec The following package was not found and will be installed: @cloudflare/[email protected] Everything is okay in the app now. You can install the npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/5786546906/npm-package-next-on-pages-418 |
Yea same error
This is the repo, maybe if you have a chance to look I would really appreciate it. I have no idea whats wrong. It is using the app/ instead of pages/ feature of NEXTJS. Its a charity project to help out a not-for-profit. |
@vans163 I've tried several ways, but couldn't be successful. I am not sure what causes this error. Although I added different versions of next-on-pages (included beta), it threw the same error. I should say that your packages are not working together. Maybe it is related to that. WARN Issues with peer dependencies found
.
└─┬ pliny 0.1.1
└─┬ kbar 0.1.0-beta.41
└─┬ react-virtual 2.10.4
└── ✕ unmet peer react@"^16.6.3 || ^17.0.0": found 18.2.0 |
Got it thanks, the complexity of this nextjs is ridiculous i will try to pull out the react components and put them into a vanilla react project. |
So moving the project out was gonna be a pain, I read carefully your PR #418 and hit a eureka. Deleting |
Now its giving
visiting any page on the router lol.. EDIT: This is most likely due to the mdx templating engine to turn markdown into html code. Dead end it seems. |
using the app router and adding a Is there any specific setting i have to set to get this working, as above is mentioned someone got a successful build.
|
Hi all, I've opened #585 to fix this issue, the changes make it so that invalid You still however cannot have a not-found route using the edge runtime. Please give the prerelease a try and let me know if it works for you 🙏 |
Thank you so much, Dario! I'll give it a shot sometime soon. I appreciate your work! |
PR #585 has closed this issue, although the situation is still not perfect I would keep this issue closed so not to keep the conversation going, making it too diluted/unfocused What things should work like right now in applications using the App router (in the latest
If you see that any of the two points above doesn't work as expected please comment here and we can reopen this issue, if you spot anything else please let's open a new issue focused on that specific problem 🙏 Sorry for the trouble here, this one is a bit of a painful issue, hopefully the latest changes help the situation 😅 |
@dario-piotrowicz after adding middleware.ts to the bootstrapped default nextjs project ( And after adding missing pages and marking all as I still get this: (latest available) Does it mean no way to run it on Cloudflare? |
@nikitaeverywhere
|
@xanderim thanks for confirming that the latest beta release does work 🙂 I've just cut a standard release so using the latest stable release should work fine now 🤞 @nikitaeverywhere please give it a try and let me know if it works for you 🙂 |
@xanderim @dario-piotrowicz thanks for the feedback. I changed the build command in CloudFlare page settings, and both "latest" nextjs 14 is however totally incapable of handling CSP but that's unrelated :D Thanks. |
@nikitaeverywhere I'm glad things work for you now 😄 🚀 Regarding Next.js 14 and CSP, sorry I am not aware of the incompatibility you're mentioning, is that something totally on Next.js? or is it something caused by our adapter? (if it's the latter please open a new gh issue for that, so that we can look into it 🙏) |
@dario-piotrowicz it's on the NextJS side completely. I personally think NextJS is just not designed to support CSP. You can find a lot of lengthy threads with other people suffering. So, as for Cloudflare, no worries at all :D |
I see @nikitaeverywhere I'm glad that it's not something we're causing 😄 (but of course I'm sad that Next.js seem to present this many issues around CSP 🥲) Anyways thanks a ton for sharing the Next.js issue, I gave it a quick scan through and it does feel like something something that could definitely come in handy to be aware of and keep in mind! so again thanks a bunch for sharing this info! ❤️ |
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
- deleted `not-found.tsx` per cloudflare/next-on-pages#413 and cloudflare/next-on-pages#174 - added `export const runtime = 'edge';` to all `layout.tsx` files
@dario-piotrowicz I still have this issue locally, I have only one not-found.js in top level npx @cloudflare/next-on-pages@latest ⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project.
⚡️
⚡️ The following routes were not configured to run with the Edge Runtime:
⚡️ - /_error
⚡️
⚡️ Please make sure that all your non-static routes export the following edge runtime route segment config:
⚡️ export const runtime = 'edge';
⚡️
⚡️ You can read more about the Edge Runtime on the Next.js documentation:
⚡️ https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes |
seeing this same issue myself, has anyone found a solution? (generally wouldn't bump but its 2.5 months old) |
Hey all, I've built on top of morphic but everytime the search results post, the app re routes to the home page ? |
For others experiencing this issue, upgrading from |
Upgrading the
This command was written by @james-elicx in the Cloudflare Developers Discord, you can find the original conversation on this Answer Overflow Page To use this command for production builds, I added it to my PS: I found a comment by James on this very issue, but his solution was hidden by the fold of comments GitHub shows. |
Sorry for the late reply (I don't really notice much comments on closed issues 😓) @anonymouscatcher and @DeJayDev if you experience the PS: @DeJayDev, please note that the command you shared (from @james-elicx) is (at least in my opinion) not really safe as that completely removes the problematic file without any guarantee that the application will run correctly in production (if you want you can indeed use it, but in that case you'd probably also want to very very thoroughly test that the built application works as intended before deploying it (with |
next-on-pages environment related information
System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103
CPU: (8) arm64 Apple M1
Memory: 16 GB
Shell: /bin/zsh
Binaries:
Node: 18.15.0
Yarn: 1.22.17
npm: 9.5.0
pnpm: 8.6.5
Package Manager Used: yarn (classic)
Relevant Packages:
@cloudflare/next-on-pages: 1.4.0
vercel: N/A
next: N/A
Description
Hi guys.
I tried to run
npx @cloudflare/next-on-pages
on Friday and got this error. (Everything was fine a day before).Vercel version had been up to 31.2.0 this day so maybe that was the problem.
When I tried to add
export const runtime = "edge";
tonot-found.tsx
page I've got this error:not-found.tsx
Reproduction
No response
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: