Shados
CDCloudflare Developers
•Created by Shados on 9/17/2024 in #pages-help
Exceptions not being logged
Hi,
I have a Remix app successfully deployed to Cloudflare Pages without issue. The app is running, working, no problem.
However, if I throw an exception for any reason, and don't handle it, I get a server error. That's expected.
What is not expected is that the logs in Cloudflare is empty. That is, if I do a try/catch and console.error my exception, that shows up fine (and the app runs successfully). But if I let the exception bubbles up, there's a server error, and the log entry is empty. The "exceptions" array in the logs on the Dashboard is an empty array, and exceptions don't show up when tailing the log through wrangler.
Is there something special to do for exceptions to be properly handled? I tried throwing the exceptions in a vanilla handler to rule out Remix and I still get the same behavior.
2 replies
CDCloudflare Developers
•Created by Shados on 9/26/2023 in #pages-help
Still can't get breakpoint debugging working in wrangler 3.9.1
Seems like a lot of work went in getting breakpoint debugging working in the last couple of releases (Thanks! I know this is hard and tedious, but Cloudflare Pages is a hard sell if debugging doesn't work 😦 ), but I still can't get it working. Neither in the cloudflare hosted devtool, or in VSCode.
The issue can be reproed with with the Remix cloudflare pages template and a simple action.
For the devtool I documented what I found there (probably not the best place since I posted after the issue was closed, my bad):
https://github.com/cloudflare/workerd/issues/371#issuecomment-1732638607
Basically, sourcemap worked for the bundler in wrangler (so it "maps" to one hop, which is the output of the Remix build), but doesn't map further, seemingly because it couldn't find the next sourcemap in the chain. If you take the sourcemap output from my bundling process, and add it to the deployed file, the devtool will show the files correctly and let you set breakpoints (everything being a few lines off because that's technically the wrong sourcemap). That issue can be reproduced in any sourcemap environment, including some visualizers, like https://evanw.github.io/source-map-visualization/
Then for VSCode, it seems similar. It cannot find the previous sourcemaps in the chain. With a launch configuration such as:
I get an error in the debug console:
file:///home/<my user>/dev/my-project/functions/%5B%5Bpath%5D%5D.js: ENOENT: no such file or directory, open '/build/[[path]].js.map'
/build/[[path]].js.map is set by Remix I think, so there might be an issue in how the files are setup to make Wrangler happy, but it's really hard to figure out what each and every tool expects, so I haven't been able to diagnose it very well.1 replies