danboyle8637
danboyle8637
Explore posts from servers
CDCloudflare Developers
Created by danboyle8637 on 5/31/2024 in #pages-help
Service Worker not updating in production or staging - Maybe not Cloudflare??
Not sure if this is Cloudflare thing??. Browser thing?? But I update my service worker version to clear caches in users browsers and reset the worker. However... in dev tools when you look at the sw code it's showing an old version. For some reason the code is getting updated in the app but my service worker is not. This is happening in Chrome and Firefox. Safari picked up the change and registered the new SW successfully. Any ideas? Sounds like a browser thing or a caching thing in the browser or build maybe?? But I wanted to start here.
1 replies
CDCloudflare Developers
Created by danboyle8637 on 5/21/2024 in #workers-help
New Rate Limiting Binding - Impossible To Add New ENV Variables?
I just noticed this morning that if you’ve hooked up the new unsafe binding to the rate limiting feature… You cannot add ENV variables in the CF Dashboard. It always errors out with: binding USER_WORKER_RATE_LIMITER of type ratelimit must have an namespace_id specified (Code: 10021) What is the best course of action? Also if you create a secret via wrangler can you add that in the wrangler.toml and have the value be read corectly? Thanks for any help!
8 replies
CDCloudflare Developers
Created by danboyle8637 on 12/13/2023 in #workers-help
Thinking Outside The Box With Durable Objects
I'm not building this yet... but just thinking about an interesting way to use Durable Objects and alarms. What do you think of using alarms to allow users to set up alarms to message the app's service worker to kick off a push notification? Besides the alarm the DO will save the custom message the user wants sent back to them. I am just thinking about ways to schedule push notifications since this is a new topic for me.
4 replies
CDCloudflare Developers
Created by danboyle8637 on 12/6/2023 in #workers-help
Best Logging Solution for Small App
I'm a little confused by all the logging options for building custom logs in a Worker. At first I was leaning toward using Worker trace events. Then I read about queues and this seems like a much better option plus easier to reason about as well. What do you all suggest? Will queues replace trace events anyway once they are out of beta?
3 replies
CDCloudflare Developers
Created by danboyle8637 on 11/20/2023 in #workers-help
Logging and monitoring for exceptions
I don't want to use Sentry for this current project. It's a small private app with very limited memberships. I want to use Workers Trace Events and push my logs to an R2 bucket. I see in the docs how to accomplish this but I'm confused as to the roll or a Tail worker in the process? Here's what I'm thinking... I use Workers Trace Events and send custom console.logs only when my Workers hits a non-200 response. I can send the function that was being called and the endpoint that failed. But would this be better accomplished in a Tail Worker? Thanks for any help on getting some simple exception logging setup.
1 replies
CDCloudflare Developers
Created by danboyle8637 on 10/21/2023 in #workers-help
Using Durable Objects in Dev Environment
In my wrangler.toml file I have this structure:
[env.dev]
vars = { ENVIRONMENT = "dev" }

[env.staging]
vars = { ENVIRONMENT = "staging" }

[env.production]
vars = { ENVIRONMENT = "production" }
[env.dev]
vars = { ENVIRONMENT = "dev" }

[env.staging]
vars = { ENVIRONMENT = "staging" }

[env.production]
vars = { ENVIRONMENT = "production" }
I created a Durable Object at the top level and I get this message when I launch my Worker in dev mode:
- "env.dev" environment configuration
- "durable_objects" exists at the top level, but not on "env.dev".
This is not what you probably want, since "durable_objects" is not inherited by
environments.
Please add "durable_objects" to "env.dev".
- "env.dev" environment configuration
- "durable_objects" exists at the top level, but not on "env.dev".
This is not what you probably want, since "durable_objects" is not inherited by
environments.
Please add "durable_objects" to "env.dev".
So I changed my configuration and added this under the dev section:
[env.dev]
vars = { ENVIRONMENT = "dev" }

[[durable_objects.bindings]]
name = "MEMBER_COUNT_DEV"
class_name = "MemberCount"

[[migrations]]
tag = "v1"
new_classes = ["MemberCount"]
[env.dev]
vars = { ENVIRONMENT = "dev" }

[[durable_objects.bindings]]
name = "MEMBER_COUNT_DEV"
class_name = "MemberCount"

[[migrations]]
tag = "v1"
new_classes = ["MemberCount"]
But I still get the same message. This is not how you add DOs to environments. What am I doing wrong. I followed a similar example in the docs about adding a KV store to multiple environments.
2 replies
CDCloudflare Developers
Created by danboyle8637 on 9/5/2023 in #workers-help
Building Webhook Best Practices (mainly for Stripe)
I am setting up my Stripe webhooks and I just want to confirm for best practices... Stripe mentions to respond with a 200 fast. I think the limit is 5 seconds before a retry is sent. When it comes to doing business logic with a Stripe event or any webhook event, should you always use waitUntil so the Worker responds with a 200 fast?
3 replies
CDCloudflare Developers
Created by danboyle8637 on 8/18/2023 in #pages-help
Use Service Bindings in local development
Is there a way to use a service binding... Pages Function to another Worker locally? The docs mention that is works but I can't find how to make it work. There is nothing further in the docs.
1 replies
CDCloudflare Developers
Created by danboyle8637 on 8/18/2023 in #pages-help
Bugs in Pages Functions?
I successfully deployed an Astro site to my Cloudflare Pages account. I'm not using SSR on this site. However, for my functions folder I'm getting two very strange behaviors. One of which I found a GitHub issue on . Sorry I don't have the link at the moment. 1. Wrangler CLI is complaining that the request is being cloned when it's not. If you do clone the request... use one of the requests... send the other to another Worker... you get two warnings of improperly cloning the request. 2. Invalid Headers I have a function route that errors immediately with a 500 and an invalid headers message. I'm not sending any custom headers. I'm not using any middleware to alter the request headers. Is anybody else seeing similar issues?
1 replies
CDCloudflare Developers
Created by danboyle8637 on 5/29/2023 in #pages-help
Wrangler CLI seems broken currently
I need to give permission to my worker and the cli opens the page to allow permission but then it goes to a broken localhost oauth url. But it can't find it. When I run wrangler login the same thing happens. I can log into my Cloudflare account fine. I tried updating the wrangler CLI package on my machine... npm update wrangler -g but the script just hangs. Anybody else experiencing any issues similar to this?
1 replies
CDCloudflare Developers
Created by danboyle8637 on 3/29/2023 in #workers-help
Using KV as a cache in the short term?
I am hooking up my backend to my frontend this weekend and eventually I want to use a service worker for caching. Until then I was planning on using KV as a cache for specific requests that don't change often. I was looking at the Cache API but since the cache only caches at the originating data center... it seems like KV would be a a better option. From a strategy perspective... is this a good move? Am I not thinking about something that I should be?
4 replies
CDCloudflare Developers
Created by danboyle8637 on 3/19/2023 in #pages-help
Service Bindings in Pages Local Mode
Is there a timeline when service bindings will work in pages local and not be undefined?
4 replies
CDCloudflare Developers
Created by danboyle8637 on 3/1/2023 in #workers-help
Running Service Binding Worker Locally With Pages App
I know this is a Pages "feature"... but Pages still uses Workers. And I got no response over on the Pages channel... surprised by that. I am trying to get my service binding to run locally so I can interact locally with my app. According to the docs... --service=<BINDING_NAME>=<WORKER_NAME> This is the flag to access a running Worker in dev mode. However, the wrangler in the CLI says service is an unknown argument. Further the docs say to run the Worker project with... wrangler pages dev --local This would not work for me. However, wrangler dev --local at least got my Worker running and I could talk to it directly... but never through the Worker I have in my Pages application. Are there known issues not stated in the docs about service bindings?
2 replies
CDCloudflare Developers
Created by danboyle8637 on 3/1/2023 in #pages-help
I'm trying to attach my Service Binding to my local dev command... --service not working
According to the docs, I'm running command to attach my service binding to my local dev environment: --service=<BINDING_NAME>=<WORKER_NAME> But I keep getting an error saying Unknown argument: service And in the wrangler help there is no --service command. I'm on wrangler 2.12.0. What should I try?
1 replies
CDCloudflare Developers
Created by danboyle8637 on 2/26/2023 in #pages-help
Access environment variables on the client
I'm not seeing anything in the docs about setting environment variables you can consume in client code. I see how to use binding for functions code. I set a variable in the back office GUI. How can I access that in my client code?
7 replies
CDCloudflare Developers
Created by danboyle8637 on 2/26/2023 in #pages-help
Solid Start Does Not Work With Cloudflare Pages
HTML minification is causing hydration issues with Solid Start. Solid Start uses HTML comments for hydration and CF is apparently stripping these and sites will build... but on first render errors pursue. For examples in production:
TypeError: Cannot read properties of undefined (reading 'cloneNode')
at yt (entry-client.c16bf715.js:1:18059)
at Object.fn (entry-client.c16bf715.js:1:23293)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
at Object.it (entry-client.c16bf715.js:1:4286)
at Te (entry-client.c16bf715.js:1:9025)
at Te (entry-client.c16bf715.js:1:9022)
at Object.fn (entry-client.c16bf715.js:1:4032)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
TypeError: Cannot read properties of undefined (reading 'cloneNode')
at yt (entry-client.c16bf715.js:1:18059)
at Object.fn (entry-client.c16bf715.js:1:23293)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
at Object.it (entry-client.c16bf715.js:1:4286)
at Te (entry-client.c16bf715.js:1:9025)
at Te (entry-client.c16bf715.js:1:9022)
at Object.fn (entry-client.c16bf715.js:1:4032)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
In development...
Error: Unrecoverable Hydration Mismatch. No template for key: 0-0-0-0-0-0-0-0-0-1-1-0-0-0-0-1-0-0-0-0
at getNextElement (dev.js:250:26)
at Object.fn (dev.js:590:43)
at runComputation (dev.js:708:22)
at updateComputation (dev.js:691:3)
at createMemo (dev.js:244:10)
at Dynamic (dev.js:580:10)
at Styled (index.js:79:18)
at dev.js:527:12
at untrack (dev.js:427:12)
at Object.fn (dev.js:523:37)
Error: Unrecoverable Hydration Mismatch. No template for key: 0-0-0-0-0-0-0-0-0-1-1-0-0-0-0-1-0-0-0-0
at getNextElement (dev.js:250:26)
at Object.fn (dev.js:590:43)
at runComputation (dev.js:708:22)
at updateComputation (dev.js:691:3)
at createMemo (dev.js:244:10)
at Dynamic (dev.js:580:10)
at Styled (index.js:79:18)
at dev.js:527:12
at untrack (dev.js:427:12)
at Object.fn (dev.js:523:37)
Is this a known issue? Is this on the roadmap?
3 replies
CDCloudflare Developers
Created by danboyle8637 on 2/26/2023 in #pages-help
ERROR reading clientNode
I am launching my first Cloudflare Pages test app to learn the Pages platform. I am familiar with Workers. I am using Solid Start. I have added the adapter. I've built my project successfully on my machine. I've added the correct setting and node version as well in the Cloudflare web GUI. My site builds successfully. But when I go to the site I get this error immediately in my console...
TypeError: Cannot read properties of undefined (reading 'cloneNode')
at yt (entry-client.c16bf715.js:1:18059)
at Object.fn (entry-client.c16bf715.js:1:23293)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
at Object.it (entry-client.c16bf715.js:1:4286)
at Te (entry-client.c16bf715.js:1:9025)
at Te (entry-client.c16bf715.js:1:9022)
at Object.fn (entry-client.c16bf715.js:1:4032)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
TypeError: Cannot read properties of undefined (reading 'cloneNode')
at yt (entry-client.c16bf715.js:1:18059)
at Object.fn (entry-client.c16bf715.js:1:23293)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
at Object.it (entry-client.c16bf715.js:1:4286)
at Te (entry-client.c16bf715.js:1:9025)
at Te (entry-client.c16bf715.js:1:9022)
at Object.fn (entry-client.c16bf715.js:1:4032)
at Ue (entry-client.c16bf715.js:1:5473)
at se (entry-client.c16bf715.js:1:5259)
The site has a red bar with a button to clear errors and try again. If I click that... it works.... but if I refresh the site I get the error again. Anybody have this happen?
1 replies
CDCloudflare Developers
Created by danboyle8637 on 2/19/2023 in #workers-help
Worker is logging requests when website is making no requests
I built a Worker to handle form requests for my website and put the data to different services I use. According to my Cloudflare back office... my Worker is logging multiple requests over the last day but none of my forms have actually be submitted. Where are these requests coming from. I am guessing the only way I can truly find out if setting up logging?
15 replies
CDCloudflare Developers
Created by danboyle8637 on 2/13/2023 in #workers-help
Cloudflare Can't Find My Service suddenly
I am getting this error when I log into my back office and go into one of my Workers: We could not find that Workers Service on your account. (Code: 10007) The Worker is receiving requests and it works in wrangler dev mode as well. I am trying to update my Worker but I can't publish it because of this error. Any ideas?
10 replies