James
James
CDCloudflare Developers
Created by Roy Sheppard on 3/26/2025 in #pages-help
Payload CMS on Cloudflare Workers/Pages
Have you tried the OpenNext adaptor? If you run into issues using it with that adaptor, please open issues on GitHub
3 replies
CDCloudflare Developers
Created by ladryk.0 on 3/24/2025 in #pages-help
Internal Server Error, NextJS, Pages
I work a job unrelated to Cloudflare during the day and answer questions relevant to projects I contribute to in the evenings outside of work. Pinging me won't get an answer any quicker. I'm afraid I don't know why your import isn't working.
27 replies
CDCloudflare Developers
Created by ladryk.0 on 3/24/2025 in #pages-help
Internal Server Error, NextJS, Pages
there have been no updates to next-on-pages, vercel cli, or next-i18n in the past week, so i doubt it would be any of those. wrangler had an update in the past week, but you said it happens on old versions as well so i wouldnt be that. Perhaps it's the build container - are you able to check build logs to see what node version/etc is used?
27 replies
CDCloudflare Developers
Created by ladryk.0 on 3/24/2025 in #pages-help
Internal Server Error, NextJS, Pages
to me that suggests an issue with the next-intl library
27 replies
CDCloudflare Developers
Created by ladryk.0 on 3/24/2025 in #pages-help
Internal Server Error, NextJS, Pages
Sounds like you're using a browser api on the server and it's unavailable
27 replies
CDCloudflare Developers
Created by ilovemesomeramen on 3/11/2025 in #pages-help
[NextOnPages] cloudflare does not cache anything
That's a fair comment. I would note that you should be able to mitigate that vulnerability with a firewall rule as well. I believe you have to opt-in to it: https://developers.cloudflare.com/waf/change-log/2025-03-22-emergency/
11 replies
CDCloudflare Developers
Created by ilovemesomeramen on 3/11/2025 in #pages-help
[NextOnPages] cloudflare does not cache anything
I would honestly recommend evaluating whether you can migrate to the OpenNext adaptor - we have a lot of cache stuff being shipped at the moment
11 replies
CDCloudflare Developers
Created by kickinrad on 3/19/2025 in #pages-help
JS.next on pages problems.
You can't use the functions directory if you're using next-on-pages as it generates its own worker to use - instead you need to use Next.js API routes.
3 replies
CDCloudflare Developers
Created by ilovemesomeramen on 3/11/2025 in #pages-help
[NextOnPages] cloudflare does not cache anything
Reading the linked issue, it sounds like something changed in Nextjs between the two versions which broke our caching implementation. Not aware of any workarounds other than downgrading or migrating to opennext
11 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
No it's a limitation from when+where the env vars are being injected
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
Locally you will need a .env file if you want to use it that way, because they're not on process.env initially, they're only on it for code run inside the vm module next.js uses for edge runtime pages.
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
is this in a deployment or locally?
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
That just tells you that they auto-populate process.env with a .env file. Secrets in Pages CI should also be available on process.env during build-time.
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
I'm afraid I don't know the internals of how Next.js decides which env vars can be inlined or not, but I would image any vars available on process.env would, so you shouldn't need to commit a .env file to pages ci
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
Next.js docs explicitly state that you need to use process.env.[variable] for it to bundle them at build time. Therefore, it would not bundle them if you are using getRequestContext. For non-bundled env vars, they will be accessible on both process.env and getRequestContext in your worker, as they are made available through AsyncLocalStorage on process.env. In next dev, you can use setupDevPlatform to setup Wrangler config stuff in the Next.js dev server VM module for the edge runtime, but this may not be a perfect experience due to HMR. If you want to use process.env, it would be simple for you to have a .env.local file for local development if you are having issues with setupDevPlatform.
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
if you want it to be inlined, you need to use process.env
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
it is when using next-on-pages
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
next.js will inline NEXT_PUBLIC_ vars at build-time if they are available and accessed with process.env https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser
42 replies
CDCloudflare Developers
Created by Kenny on 3/3/2025 in #pages-help
NextJS NEXT_PUBLIC vars on the client
if they're not available, then they might not be being inlined properly
42 replies