-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raven-js not working with create-react-app #844
Comments
Hey @rbndg – could you clone your repo and put it up on GitHub so I can inspect what's going on? |
ping Any news here – can you provide me with an example repro? |
Same problem here, Raven doesn't send anything. I didn't try to log errors with Raven.captureException. My code is fairly simple: App.js import Raven from 'raven-js';
Raven.config('<my-sentry-url>').install(); However, when I copy/paste the Raven-js code in my console, it catches and sends errors. |
I need a full repro. I've been using create-react-app internally to demo Sentry and it's worked fine for the past few months. |
Did anyone solve this issue after it being closed? I am having this exact same issue. |
What's exactly the issue? Can you provide your config/repro case? Without it, I cannot tell much. |
I'm also having this issue. |
@joshmreesjones what's the issue exactly? What's your setup? Your config? Can you provide reproducible repository? It's very hard to debug without knowing any of those things :) |
@benvinegar what's the Right Way to add raven to an app that's been created with create-react-app? Because of the need to load before bundles, I'm kind of assuming the public/index.html is the right place, but knowing how you're doing it successfully would be great! |
That's what I've done. I add a |
@benvinegar perfect, thanks! Does it Just Work even with react 16 or would someone need to add specific support for the error boundaries? |
Hey @jamesmanning, it'll work just fine out of the box. You can read how to use error boundaries here though - https://blog.sentry.io/2017/09/28/react-16-error-boundaries One thing to keep in mind is that React does bubble all the errors in development mode, even those caught by error boundaries (here's more context you can read about #1249 (comment)) |
edit : This is a way to include raven only in production mode :) <% if (process.env.NODE_ENV == 'production') { %>
<script src="https://cdn.ravenjs.com/3.26.2/raven.min.js" crossorigin="anonymous"></script>
<script>Raven.config('https://ba44729431a044d6915d8012e94d8a56@sentry.io/1230983', {
environment: "%NODE_ENV%",
}).install();
</script>
<% } %> |
Hello, I built an app using create-react-app (https://github.com/facebookincubator/create-react-app), however Raven-js isn't able to pick up errors.
I'm however able to log errors with Raven.captureException.
I'm using the latest version of sentry and i followed the instructions on the Sentry website.
The text was updated successfully, but these errors were encountered: