Alexey
Alexey
CDCloudflare Developers
Created by Alexey on 2/16/2024 in #pages-help
“wrangler pages functions build” yields output with different filenames
I'm building my Pages' functions with the following command wrangler pages functions build ./functions --sourcemap --compatibility-flags=nodejs_compat --outdir=./dist-functions/ Its output is either index.js + index.js.map or _worker.js + worker.js.map Why is that? How can I ensure it's output is the same all the time? How can I make it always be _worker.js + worker.js.map? Wrangler version: 3.28.2 I tried to use --outfile option instead of --outdir , but in this case the sourcemap stops generating.
1 replies
CDCloudflare Developers
Created by Alexey on 2/13/2024 in #pages-help
Pages Functions Bundle post-processing
I need to upload Functions bundle's source map to Sentry + post-process both the bundle and its source map to inject Sentry's debug-id https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/#3-inject-debug-ids-into-artifacts AFAIU I need to do the following: 1. use wrangler pages functions build --sourcemap to generate the bundle and its source map. 2. do the necessary post-processing of the generated files 3. rename the bundle file to _worker.js and put it into the ./dist folder (output folder for all static files) 4. run wrangler pages deploy ./dist command to deploy Pages. It will ignore ./functions folder and use _worker.js file instead. Questions: 1. Is my approach correct? 2. Any pitfalls? 3. What about routing? In my case Cloudflare won't automatically generate routes based on the ./functions structure. What's the effect? 3. Does it worth documenting such a use case? It's not a trivial workflow and the wrangler pages functions build is not documented at all.
2 replies
CDCloudflare Developers
Created by Alexey on 2/7/2024 in #workers-help
[Tail Worker]: Exceptions Stacktraces
I use Tail Worker to report errors to Sentry. The exceptions prop doesn't contain stacktraces, just an error message. Is there a way to get stacktraces from the exceptions?
1 replies
CDCloudflare Developers
Created by Alexey on 2/6/2024 in #workers-help
[Sentry] Workers bundle post-processing
I want to configure sorcemaps to work with Sentry. Sentry needs to inject DebugID into the minified bundle and into the sourcemap file https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/ It means I need some kind of build post-processing before deploying my worker. How can I achieve that?
4 replies
CDCloudflare Developers
Created by Alexey on 2/4/2024 in #workers-help
[Tail Workers]: passing additional data to Sentry
I use tail workers to report error data to Sentry - data from console.log and exceptions. I need more info in Sentry to identify users, get more context and set proper Sentry tags. How to I pass such such additional info from Producer workers to Tail workers?
1 replies
CDCloudflare Developers
Created by Alexey on 1/29/2024 in #workers-help
[Tail Workers in Development] - how I can test them and validate locally?
I put both tail worker and producer worker in the same worker, but logs from wrangler dev seem to show only output from producer, not the tail worker. It's not clear how to verify locally if tail workers work correctly Also if there is a way to call tail workers directly, would be really handy
2 replies