Ping for toast
Explore posts from serversCDCloudflare Developers
•Created by Ping for toast on 9/25/2024 in #workers-help
In CI, setting a newer wrangler target causes `npm i [email protected]` which causes error
2 replies
Infinite context loop in start dev?
Hi, I have , and I'm noticing that this createResource is running forever as fast as possible, on the server, when its in dev. I'm trying to discover the root cause of it, but it only happens in dev. I'm posting this half for help, and half to help others when I uncover the issue
15 replies
CDCloudflare Developers
•Created by Ping for toast on 5/23/2024 in #workers-help
[VERY EXTREMELY CURSED] How can I access process.env (at start time)
Ahoy! I need .env to instantiate my jwt server. I've spent so much time of my life reading minified code and dealing with build tools, BUT I HAVE NO IDEA WHATS GOING ON!!! Solid start somehow uses vite, rollup, esbuild, vinxi, and nitro. and then I suppose cf is doing its own polyfills Has javascript gone too far???? But anyway
My first attempt is
but this didn't work, process.env is undefined despite node.js compat being enabled. Looking inside the bundled code, I see
.use(jwt({secret:J.env.JWT_SECRET
, what is J? const J=H.process
. Ok lets zoom out
ok so nitro is being "helpful" and injecting unenv into the game. Ok so its looking at globalThis.
Whats in globalThis? console.log(globalThis)
OH LAWDY WHAT IS THIS (hahah globalThis get it puns?)
1/?79 replies
Secret Changing
@Brody asked me to open this. I was having issues with my secret changing every deploy. I think the cause of this was I did the secret inside an already existing project, not a template. But having the secret changing every deploy in every case is not fun.
10 replies
Await Resource
I have an authentication context wrapping the router
And later use the session context in certain functions
But it appears that in some contexts,
useSession
is still unloaded when it is called. I need some way to await the resource ready state if it isn't ready already, or some better way to do this2 replies