Kris
Kris
CDCloudflare Developers
Created by Kris on 1/3/2025 in #workers-help
pnpm with Workers Builds
What's the best way to use pnpm with Workers Builds? Build output suggests it's detected but not installed.
09:12:56.850 Initializing build environment...
09:13:07.058 Success: Finished initializing build environment
09:13:07.184 Cloning repository...
09:13:09.031 Detected the following tools from environment: [email protected], [email protected]
09:13:09.034 Restoring from dependencies cache
09:13:09.036 Restoring from build output cache
09:13:09.290 Installing project dependencies: pnpm install --frozen-lockfile
09:13:09.527 No preset version installed for command pnpm
09:12:56.850 Initializing build environment...
09:13:07.058 Success: Finished initializing build environment
09:13:07.184 Cloning repository...
09:13:09.031 Detected the following tools from environment: [email protected], [email protected]
09:13:09.034 Restoring from dependencies cache
09:13:09.036 Restoring from build output cache
09:13:09.290 Installing project dependencies: pnpm install --frozen-lockfile
09:13:09.527 No preset version installed for command pnpm
9 replies
CDCloudflare Developers
Created by Kris on 11/3/2023 in #pages-help
Error 1105 on initial request
In the last week, I've started getting Error 1105 on first request to a Pages site backed by a Pages Function. Refreshing usually loads the page. That error isn't documented. Any ideas how to diagnose this? In the Pages Functions log, the request shows as canceled.
1 replies
CDCloudflare Developers
Created by Kris on 9/11/2023 in #workers-help
Sourcemapped stacktraces in the dev console
Does anyone have sourcemaps working in dev in the console? My workers mainly run off queues (so no HTTP response to display). I've gone down some rabbit trails with miniflare, Stacktracery, etc. trying to see if there's a way to translate console logs to original Typescript sources, but no success yet.
1 replies
CDCloudflare Developers
Created by Kris on 7/11/2023 in #workers-help
Long-running worker performance
I've implemented a background sync worker, triggered by a queue. It calls an external, paginated API (dozens of sub-requests) and performs 100s of SQL queries using the socket API. This works wonderfully, but it's very slow. Where a local execution might take 2-3 seconds, in production it takes over 60. Some syncs are ~5 minutes. Any tips on how to diagnose the slowdown in production, or where to look to optimize? Off the top of my head, the source could be: 1. Roundtrips to/from the DB server (which is local in dev, and supabase.co in prod) 2. Worker CPU speed (don't think I'm doing anything too CPU intensive, but there is some list processing) 3. Sub-request (or socket) latencies
7 replies
CDCloudflare Developers
Created by Kris on 5/20/2023 in #workers-help
Skipping a module when bundling
Has anyone found a way to skip a module dependancy when bundling? I'm using googleapis, which has a require('http2') while http2 isn't available in the runtime. That might be fine -- I think I can pass runtime options to avoid using it. I just need to find a way to get esbuild to ignore the missing dependancy.
1 replies
CDCloudflare Developers
Created by Kris on 5/6/2023 in #pages-help
Debugging Remix server-side 500s
After pushing a change to a Remix app to Pages + Functions, I'm getting 500 errors in the browser, but Cloudflare Pages Functions logs show "successful" requests. How do I get the underlying error?
{
"outcome": "ok",
"scriptName": "pages-worker--1051688-production",
"exceptions": [],
"logs": [
{
"message": [
"Error: Unexpected Server Error"
],
"level": "error",
"timestamp": 1683332030573
}
],
"eventTimestamp": 1683332030459,
"event": {
"request": {
"url": "https://dd33ea81.cf-remix-65c.pages.dev/",
"method": "GET",
"headers": {
...
},
"cf": {
...
}
},
"response": {
"status": 500
}
},
"id": 0
}
{
"outcome": "ok",
"scriptName": "pages-worker--1051688-production",
"exceptions": [],
"logs": [
{
"message": [
"Error: Unexpected Server Error"
],
"level": "error",
"timestamp": 1683332030573
}
],
"eventTimestamp": 1683332030459,
"event": {
"request": {
"url": "https://dd33ea81.cf-remix-65c.pages.dev/",
"method": "GET",
"headers": {
...
},
"cf": {
...
}
},
"response": {
"status": 500
}
},
"id": 0
}
2 replies