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

NextJS gives TypeError but only on cloudflare pages

I get "TypeError: Illegal invocation: function called with incorrect this reference. See https://developers.cloudflare.com/workers/observability/errors/#illegal-invocation-errors for details." but only when deployed. I do not get any errors on my localhost.

Plain text type environmental variables not included in build runtime

Heyo! I've been running into a few issues with getting Cloudflare environmental variables working with my Vite frontend. Initially in my Vite build config I tried using the define property and accessing the variables from process.env, however after some further digging and logging of process.env in the build output, it appears that only variables with the type set to secret are passed into runtime. Does anyone have any suggestions on how to approach retrieving plain text variables without changing them to be secrets?...
No description

React app won't deploy

Getting a error deploying a page ``` 18:43:58.420 Preparing [email protected] for immediate activation... 18:43:59.112 Installing project dependencies: yarn --pure-lockfile --no-progress --emoji false 18:43:59.391 Corepack is about to download https://repo.yarnpkg.com/4.5.1/packages/yarnpkg-cli/bin/yarn.js....

I'm struggling to use a page function (for a simple contact form) with Astro

I've been following https://developers.cloudflare.com/pages/functions/plugins/static-forms/, I've put code in functions/contact.js: import staticFormsPlugin from "@cloudflare/pages-plugin-static-forms"; export const onRequest: PagesFunction = staticFormsPlugin({...

Build command setting always applied to both environment

From Works & Pages >Ā {projectName} >Ā Settings >Ā Build. The build command set in the "production" environment is applied to "preview" environment as well. Same if applied from the "preview" environment, it is automatically saved to the "production" environment as well. Step to reproduce:...

Deployed but not working...

I've deployed to https://physiotherapy-web.pages.dev/ and it shows everything in the build steps progressing fine, but for some reasons the website is just not accessible.

Cloudflare Pages Deployment Issue -

I'm experiencing critical deployment problems with my site: During DNS configuration of the subdomain , if proxy status is set to, 1. Proxy Status : Proxied - When set to "Proxied", the URL is unexpectedly redirects to a different page that we do not control....

Reaching the limit of pages function

How do I apply for capacity expansion?
No description

_headers file and Astro

Hi all, new to CF Pages and Astro (static generated). Even so, I've managed to create a nice blog site pretty quickly. However, I want to make use of some custom headers but I can't figure out how to make the Astro build process create a file called _headers in the dist root folder. If I create a /src/pages/_headers.js, the Astro build ignores it. If I rename to headers.js it produces the correct output but with the wrong name, Can anyone guide me to the correct process please? Thanks....

Pages Github Integration Link Broken

Clicking connect to github links me to a dead page on cloudflare (404)

Deployment Issues on Cloudflare Pages with SvelteKit 5

We are encountering issues while deploying two separate SvelteKit 5 projects to Cloudflare Pages. The build process fails with errors related to resolving component paths or modules. Here are the details of the issues: 1. Project 1: DApp SvelteKit Boilerplate
Error:
```plaintext...

This site canā€™t be reached

Hi, IĀ“m trying to upload my Remix project for 2 days now. I started without the cloudflare template but migrated everything to the cloudflare template. The site works just fine on localhost. I pushed it to git and connected to cloudflare....

WebSockets: Uncaught (in response) Error: The script will never generate a response.

I have a very simple function that listens for WebSocket connections and sends the current time whenever a message is received: ```typescript export const onRequest: PagesFunction = context => { const upgradeHeader = context.request.headers.get("Upgrade") if (upgradeHeader !== "websocket") {...

import.meta.env in cloudflare pages

Whenever I try to use import.meta.env I get undefined, but process.env works. Is there a reason for this? There's one post on the forum, but no one has answered yet. https://community.cloudflare.com/t/access-environment-variables-in-pages-in-ssr/725469...

How to skip pnpm install?

I have a mono repo with multiple sites. pnpm install was executed before my build script. I'd prefer pnpm i --filter domain.com^... instead to narrow the scope and save some build time. How can I achieve this?...

Next.js 14 app fails when deploying on Cloudflare

Can someone please help me with this - the builds were going through without a problem yesterday and the app still builds without a problem locally but it fails on Cloudflare Pages
No description

Next.js 14 app fails when deploying on Cloudflare

When trying to deploy on Cloudflare, build fails with
No description

Pages build failing because Puppeteer won't launch.

I'm trying to inline Critical CSS on my page to get that perfect 100 score [Performance] in Lighthouse. I'm using Astro for my site, and the integration astro-critical-css helps in doing that. Since it uses Puppeteer under the hood to do it, I'm getting this error on deployment: ``` 14:58:27.632 Error: Failed to launch the browser process!...

--frozen-lockfile?

My builds broke and when took a look pages is now using pnpm install --frozen-lockfile any idea how to revert it back to how it was originally?
Next