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

Error 1101 on code surrounded by try/catch

I'm deploying a Nuxt.js application and my pages event handler is being called but somehow seems to just "stop" executing code and I get the Error 1101 message. The reason I say stop is that I've added console.log lines between every single statement to pinpoint what is going on and the entire thing is wrapped in a try catch block but the catch is never being called....

email worker doing the opposite

`export default { async email(message, env, ctx) { if (message.headers.get("from").includes("Mark Mateschitz")) { await message.forward("<me>"); } else {...

How do I get element innerHTML using HTMLRewriter?

Here's my code: ```ts const rewriter = new HTMLRewriter().on('#element', { element(element) { // Somehow get element innerHTML...

GitHub action cloudflare/wrangler-action@v3 + Hono + Zod = error about Husky

Hey everyone, So I don’t fully understand yet if the issue comes from the GitHub action or from Zod but whenever I run my CI, it fails and says stuff about Husky (see attached), which I'm not using. I attempted two commits in a row, one without Zod which went through and another with Zod (just installed, I didn't use it in the app) and it triggered once more the error....
No description

Several websites via Workers

Hello! We have started working on an application that requires the same site to be visible in three different countries, and the hosting needs to be on servers from that countries. We are also keen that there should not be three different hosted instances of this application, but that it should somehow be moved to one our main server. Do you have any ideas on how to do this in an optimal way?...

workers.api.error.tail_not_allowed [code: 100150]

I was trying to deploy a worker that connect to a tail worker, but wrangler gave me an error:tail_not_allowed [code: 100150] Here is my wrangler.toml ``` name = "check-ios-app-update" main = "src/worker.js"...

Rate Limiting

How can I set duration, like for 5 minutes the user should be rate limitted when Rate Limitting. ```// Rate limitting const clientIP = request.headers.get('cf-connecting-ip'); const { success } = await env.RATE_LIMITER.limit({ key: clientIP || '' }); // key can be any string of your choosing...

import is undefined

I'm using a package called samlify which has imports some items from package node-forge,. For some reason, the node-forge imports are undefined in the cloudflare worker. I'm getting an error TypeError: Cannot read property of undefined (reading 'decode64') .... Can anyone help?...

Forgot Password

Hello, I forgot the password to my Cloudflare account. I don't receive the email about resetting my password. I've tried this several times and it also doesn't end up in the spam folder.

KV - Some clients get null value for existing key.

This is VERY weird. I've got a simple link shortening service. On the same network, two different clients calling GET http://<URL>/slug This calls env.SHORTENED.get(slug) on the worker. ...

In email workers, can I send mail to a new domain without new settings, distribution?

When I send mail to email workers, can I send mail to a new domain without new settings, distribution? https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/ I was looking at the docs to replace mailchannels, and found that there were email workers. ...

Mail Channels alternatives

The title says it all, EOL coming up soon. Can anyone reccomend a cheap/free alternative? Does CF have plans to rolls its own email service?

How to deploy discord bot app through workers ?

I've followed Discord tutorial step by step and got issues with node compatibility ! I need to know whether is possible to deploy my bot app builts with discordjs to cloudflare or not; thanls Source: https://discord.com/developers/docs/tutorials/hosting-on-cloudflare-workers#creating-your-cloudflare-worker...

pointing a custom subdomain to worker

I'm struggling to figure out how I can get a custom subdomain connected to my worker when my DNS is hosted externally Is this impossible without a business plan? There must be some way to get this to work....

SAML

I'm looking for a SAML typescript library for my Nuxt pages/worker app. I'm currently trying to use samlify but I'm getting a 500 error Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler. and I believe it's causing it.

node modules in workers

how can i import functions from node modules on npm either with workers or something else? im trying to request an api then respond with a modified version of the api

What path to pass to fetch to fetch from bound service/worker

Hey, I am trying to figure out what path to pass to the bound worker in my fetch request. Is there some internal domain name resolution? Usecase is a pages function calling a worker that it has declared in it's wrangler.toml.

CPU exceeded error

Hi team, I'm trying to create a PDF file that has 20-30 pages, and the cpu time exceeds the limitation. What is the best option to solve this issue? Should I upgrade to Unbound model ...

Excluding Tests

Hi All. I am building a service with Workers and I have my tests in a subfolder of each controller "{controller_name}/specs". I am concerned about them bloating the package when I deploy to production. Does anyone know the correct and preferred way to exclude them from the production build?