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
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