You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not Working with Cloudflare workers: dist.init is not a function #1665
I'm trying to use Sentry's javascript SDK with cloudflare workers, however I'm getting an error using either @sentry/minimal, @sentry/browser or raven-js.
If the preview has stopped working you should be able to run a new preview with simply yarn && python preview.py.
Uncaught TypeError: dist.init is not a function
at Module.<anonymous> (worker.js:1863:13)
at __webpack_require__ (worker.js:20:30)
at worker.js:84:18
at worker.js:87:10
I also tried @sentry/browser but an error The 'referrerPolicy' field on 'RequestInitializerDict' is not implemented. which makes sense. raven-js gave yet another error.
I've updated the code to log errors to sentry directly and that's working fine.
If you want to replicate the error you'll need to use this commit which actually uses raven-js and edit from there, I don't have a commit with @sentry/minimal or @sentry/browser I'm afraid.
Just to confirm, personally I don't need this anymore as I spent Friday afternoon ignoring my real work and building my own sentry logger which plays nicely with web worker's event.waitUntil() and even uploads source maps to sentry so I get full traces.
Activity
samuelcolvin commentedon Oct 19, 2018
I'm aware of https://blog.cloudflare.com/dogfooding-edge-workers/ but I was hoping to use the standard sentry sdk.
samuelcolvin commentedon Oct 22, 2018
I've updated the code to log errors to sentry directly and that's working fine.
If you want to replicate the error you'll need to use this commit which actually uses raven-js and edit from there, I don't have a commit with
@sentry/minimalor@sentry/browserI'm afraid.HazAT commentedon Oct 22, 2018
How does your
import/requirestatement look like of@sentry/browser?samuelcolvin commentedon Oct 22, 2018
I think you mean
@sentry/minimal? (@sentry/browserfailed with an understandable error aboutreferrerPolicy)Here's my code:
And here's a branch with that code on it.
And here's a worker preview with that code running.
samuelcolvin commentedon Oct 22, 2018
Just to confirm, personally I don't need this anymore as I spent Friday afternoon ignoring my real work and building my own sentry logger which plays nicely with web worker's
event.waitUntil()and even uploads source maps to sentry so I get full traces.samuelcolvin commentedon Oct 22, 2018
(and let's me include
extraincaptureMessage#1666 😉)HazAT commentedon Oct 22, 2018
You can write your own
transportclass and still use Sentry.samuelcolvin commentedon Oct 22, 2018
would that solve the
dist.init is not a functionproblem?HazAT commentedon Oct 22, 2018
No, but I
referrerPolicyerror, I think.tbh I am not sure where this is coming from though.
kamilogorek commentedon Oct 31, 2018
The initially reported issue is resolved I guess, so let me close it. Feel free to ping me if this still needs to be reopened. Cheers!
Add an offline integration for offline errors
Add an integration for offline errors
Add an integration for offline errors
tlianza commentedon Nov 10, 2019
@samuelcolvin - this project might be of interest to you: https://github.com/tlianza/pigeon - I wrote it while trying to solve what sounds like the same problem.
kamilogorek commentedon Nov 11, 2019
@tlianza nicely done! Love that someone used our custom client/backend architecture :)
btw. name Raven comes from https://liquipedia.net/starcraft2/Raven_(Legacy_of_the_Void) (same as Sentry itself https://liquipedia.net/starcraft2/Sentry_(Legacy_of_the_Void)) but I love Pidgeon! 😄
berkant commentedon Oct 6, 2020
I can fix the referrerPolicy issue by commenting out that line in fetch call. There are still various issues with the SDK on Workers though.
tlianza commentedon Oct 6, 2020
FYI I'd recommend this library these days: https://github.com/robertcepa/toucan-js