Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

Refused to execute script because its MIME type ('text/html') is not executable

Hey, I deployed my next.js site with clerkdev authentication on cloudflare. I get this error in console only when user is logged in. Failed to load resource: the server responded with a status of 404 ()...

Default page instead of 404

I am wondering if I can redirect the user to a default page (eg. index.html) if the route that user provided does not exist. I don't want to show the user a 404 page.

Create project with CF API - Incomplete info

When I create a new CF Pages project using the API: https://developers.cloudflare.com/api/operations/pages-project-create-project The request is successful but when I go to the dashboard I see that the "Builds & deployments" information is missing. And I am sending it in the payload as requested by the API. ...

Client side errors out when using SSR

Domain: https://sticksdev.tech/ (click on projects and any project) Source page: https://github.com/SticksDev/portfolio-new/blob/main/app/projects/%5Bslug%5D/page.tsx It errors out with the "Application error: a client-side exception has occurred (see the browser console for more information)." ...

Unknown Error

Hello, keep getting this error. EXCEPTION (rollback) [code: 500] DETAILS: { "result": null, "success": false,...

Dynamic routes with static pages

I'm building a site which is composed of a static html landing page at "website.com/" and a React app at "website.com/{anything here}" which reads the path to dictate its content with react-router. Is there a simple way with pages to serve a static subpage (the react app) with a wildcard (without a worker)? I know there's a worker solution but I'm curious if there's a feature for this within basic pages

Next.js 13 + next translation to Cloudflare Pages

Hello, I see that a fix has been released but I still can't use next translate with the edge. My problem is :...

Next.js Error: Function Script over 1MiB size limit

Recieved this Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large) How to tackle? All I did was added auth with clerkdev. I am using edge functions....

Nextjs, next-on-pages, "hanging Promise was canceled"

Hi all, I'm trying to build a statically rendered site on Pages using Next. I have a dynamic route as follows: /app/(content)/articles/[slug] that will render content pulled from a headless CMS. When I use npm run dev with Next, these routes work fine. but when I build the site with npx @cloudflare/next-on-pages@1 and then use wrangler to do a preview, it works for other non-dynamic pages but throws on the [slug] with:...

NextJS Monorepo Setup

Is it possible to deploy a NextJS app from a turbo monorepo

Correct way to implement _redirects file functionality for a Pages project using Next edge runtime?

Hi there, I've seen in a previous post that SvelteKit and _redirects seem ot be incompatible. I am experiencing this issue on my own Pages site unfortunately, and I'm wondering if Cloudflare has any guidance on a correct solution. I don't necessarily need the _redirects file to live in my repo. I'm happy to use a different Cloudflare product for managing this, I'm just not sure which one would be the simplest to maintain and implement. Thanks!...

Trying to pass data from middleware context.data = {id:1} to a function, not working :(

Hi, I have a middleware inside functions/api/_middleware.ts now I'm trying to pass some data from that middleware to a function like I want to access that data on onRequest(data) like that. right now, it returning an empty object.

Middleware not working as excepted

Hi, I have this middleware, it works as excepted but only one problem, if it throws any error then the middleware keep looping, like keep sending infinite requests. but if I used status: 200 from catch block then it works fine without any issue, I can't find any issue, But I think I have to do something with "options" method I guess, to me it seems it's happening for options method ```// functions/api/_middleware.ts export const onRequest: PagesFunction<Env> = async ({ next, request, env }) => {...

Nuxt 3 / jsonwebtoken / Error: Failed to publish your Function

I am using Nuxt 3 with Cloudflare Pages. The build works fine and it correctly uses the nitro-preset "cloudflare-pages". I am also getting a "Success: Assets published!" message but after that it fails with the following error message: Error: Failed to publish your Function. Got error: Uncaught TypeError: Object prototype may only be an Object or null: undefined The error only occurs when I am using the verfiy/sign functions provided by jsonwebtoken. When replacing the jsonwebtoken package with @tsndr/cloudflare-worker-jwt it works as expected....

Some people get ERR_CERT_AUTHORITY_INVALID on a custom domain

Getting a few reports of people on Chrome getting NET::ERR_CERT_AUTHORITY_INVALID when accessing https://charity.cdawgva.gg. Pages url: https://cdawg-auction.pages.dev Account ID: 54392aaba81d753fd12c3b659b790ed4...

Cannot find module '@napi-rs/simple-git-linux-x64-gnu'

Hi again 🙂 I'm trying to deploy a Nextjs project to Pages, a different one to my previous thread. However, this one fails because of the following error:...

Package "path" not found during build

Hey I am getting a path package error when deploying my applicaiton ````...

Pages not creating Worker, NextJS returns 404

Hi, I am deploying a NextJS project to Pages, however, every route returns a 404. It uses the Edge runtime and only contains dynamic pages. It succesfully compiles en uploads the assets, but it's not creating a Worker it seems....

How to use node_compat = true with cloudflare pages ?

I know that there is a flag nodejs_compat, but it's not as powerful as node_compat = true , nice nodejs_compat isn't gonna polyfill modules such as fs or os How could I use node_compat = true with a cloudflare pages (not worker) project ? Can I do it directly with the cloudflare UI/Dashboard ?...

Cloudflare DNS issue (getaddrinfo ENOTFOUND) with Cloudflare pages site

Getting this error: getaddrinfo ENOTFOUND at https://texmexcleaning.com Here is the pages site that it is setup to cname to: https://texmexcleaning-com.pages.dev/ Went down at 2023-06-06 04:54:31.779 (UTC)...