Clown Studios
Clown Studios
CDCloudflare Developers
Created by will smith on 10/20/2024 in #pages-help
How to debug remix latency
the 300ms delay you're seeing between the eventTimestamp and the first log in your remix loader could be due to cold starts or routing issues within cloudflare pages. since this isn’t using workers, the delay could be caused by the edge node spinning up or your pages app going idle after some inactivity. to debug this, try enabling detailed logging for your remix app to track where the delays are occurring. you can also check the cloudflare cache configuration—make sure static assets are cached at the edge to reduce the load on your remix app for each request. if your app makes any external API calls or database queries within the loader, those could also be introducing latency. you can further reduce this by prefetching or optimizing those calls.
2 replies
CDCloudflare Developers
Created by axylos on 10/17/2024 in #pages-help
Preflight requests to static Pages are returning 405
cloudflare pages doesn't natively handle preflight OPTIONS requests, which is why you're getting the 405 status code. without using a worker or function, there’s not a built-in way to manage CORS preflight responses directly. one workaround is to set up a reverse proxy on a separate server or use a custom domain with proper CORS headers for your static content. you could also explore configuring custom headers through the cloudflare dashboard for your static assets, though that might not fully resolve preflight issues. if you're avoiding workers for cost reasons, consider limiting preflight requests by optimizing your frontend to reduce CORS requests where possible.
2 replies
CDCloudflare Developers
Created by Przemek Fieluba on 10/22/2024 in #pages-help
Error during deploy example test project started in nuxt
it looks like the issue is with the wrangler trying to locate the bundled worker file in the wrong directory. the error ENOENT: no such file or directory means it's looking for a file that wasn’t generated or placed where it expects. try clearing the .wrangler directory and rebuilding the project from scratch. you can also check if the dist directory is being built correctly by nuxt. if the problem persists, consider checking your wrangler config or try running npx wrangler pages publish dist instead of deploy to see if it resolves the issue.
2 replies
CDCloudflare Developers
Created by PJP on 10/21/2024 in #pages-help
Remix app getting sporadic 404s on assets that are in the deployment
this sounds like a caching or routing issue. cloudflare pages might be caching old assets or misrouting requests intermittently, causing your remix app to handle asset requests as routes. you can try tweaking your cache settings to ensure assets aren’t incorrectly cached, or implement cache busting by adding versioning to asset filenames. also, check your remix route configuration to make sure asset routes aren’t accidentally falling through to your catch-all route. since it’s hard to reproduce, it might be worth looking into any cache invalidation or purging strategies in your ci/cd pipeline as well.
2 replies
CDCloudflare Developers
Created by DrKayBee on 10/9/2024 in #pages-help
Unable to override build settings when deploying
changing the build command to npm install --force && npm run build might not work if the settings are cached or not properly applied. try clearing the cache or rechecking the settings in cloudflare pages. using npx wrangler pages deploy works but breaks git integration, and git actions are a bit heavy just to override a build command. you could also try adding a .npmrc file to manage npm install --force directly without needing to override the entire build command.
3 replies
CDCloudflare Developers
Created by ericmatthys. on 10/9/2024 in #pages-help
How best to use jsx / tsx entry point with `cloudflare pages dev`
sounds like you're running into a parsing issue with jsx in cloudflare pages functions. since miniflare doesn't support jsx out of the box, you could try adding a build step using esbuild or another lightweight bundler to transform your jsx into plain js before running it with cloudflare pages dev. unfortunately, without vite or webpack, there's no built-in way to handle jsx directly in that environment. it seems like wrangler pages functions build can handle it because it's doing the transformation for you. you could try setting up a basic esbuild config to transpile the jsx before running your dev server.
2 replies
CDCloudflare Developers
Created by anand248 on 10/13/2024 in #workers-help
Which library do you use to generate pdf at worker side?
i'd recommend using pdf-lib or pdfkit for generating PDFs on the worker side. they tend to be more compatible. if you're getting module errors with jspdf or pdfmake, those libraries might not work well in that environment.
2 replies