question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hosted sentry script breaks with require.js

See original GitHub issue

Hey, 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:closed
  • Created 10 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mattrobenoltcommented, Apr 13, 2013

If I just change it to:

define('Raven', [], function() { return Raven; })

Does that solve the problem? I’m not super familiar with require.js, I just implemented what the spec said. 😃

0reactions
calvinfocommented, May 7, 2013

cool, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hosted sentry script breaks with require.js · Issue #97 - GitHub
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 ...
Read more >
Troubleshooting for JavaScript - Sentry Documentation
Updating to a New Sentry SDK Version. If you update your Sentry SDK to a new major version, you might encounter breaking changes...
Read more >
Occasionally getting Reference Error in Javascript console
I am occasionally getting different types of Reference errors logged in chrome console. For eg: require not defined; Cookies not defined; lozad ...
Read more >
Usage | Sentry Documentation
This data is generally submitted with each error or message and allows you to figure out which users are affected by problems. Capturing...
Read more >
JavaScript - Docs - Sentry Documentation
It's possible to include defer in your script tag, but keep in mind that any errors which occur in scripts that execute before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found