Hosted sentry script breaks with require.js
See original GitHub issueHey, I’m not sure whether this is a valid request for the open source version or the hosted version. Let me know if there’s a better place to submit this - it’s breaking for some of our customers who use require.js and hosted sentry.
There’s a mismatch error which happens when using the hosted version of sentry with require.js on the page.
Require.js complains when you use an anonymous define, but still insert the script itself directly into the page (rather than requiring it). This happens in the footer of the sentry js, even though sentry technically follows the AMD spec by omitting the id.
The reason require.js throws is because it doesn’t want any non-require’d assets floating around that aren’t explicitly named. I’m pretty sure jQuery handles this by using a named export for AMD. I suppose you could also surround the define
call with a try…catch if you didn’t want to specify a name for your dependency.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top GitHub Comments
If I just change it to:
Does that solve the problem? I’m not super familiar with require.js, I just implemented what the spec said. 😃
cool, thanks!