-
Notifications
You must be signed in to change notification settings - Fork 27.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
with-sentry-simple example doesn't work in server although it says it does. #8106
Comments
I alse have the question. #8292 |
Yeah I'm having the same issue, trying to understand what's up. Il try and provide some input whenI get something as well |
Try to put below on
|
@shuhei-tagawa The alias shouldn't be needed in I would import the node package instead of the browser one here: https://github.com/zeit/next.js/blob/97e40057bb6518a6cd058883c65e5d8cab791cf4/examples/with-sentry-simple/pages/_document.js#L2 -import * as Sentry from '@sentry/browser'
+import * as Sentry from '@sentry/node' and make sure |
Some notes on how to get this working:
Note that I'll see if I can make a PR to the example if I get time. @leerob maybe we can collaborate. I want there to be a simple way to integrate Next.js with Sentry as well, that doesn't involve a custom server. |
@WestonThayer Thanks for all the info. A PR to the example would be super helpful! |
For people looking to implement Sentry with Next.js, make sure to check out https://github.com/UnlyEd/next-right-now Interesting parts are:
|
Thank you for this great boilerplate project as a reference point. I'm still encountering one problem regarding source maps. For some reason, my source maps are not uploaded to sentry while even using the |
@saltz If you're trying it out locally then I'm pretty sure it doesn't work. I believe it does work on production. I think that's because uploading source maps to sentry takes some time and wasn't implemented in development. I may be wrong. |
No sorry, I forgot to mention, the web-app is deployed and is running using the command |
@saltz Thank you for your feedback. I can confirm that it doesn't work either on my side. I'm not sure where the issues comes from though, this will require some investigation. i'll try to take a quick look. Created an issue to track this for NRN: |
Is there a simple fix for getting with-sentry-simple working? There should be a simple way to integrate Sentry with Next.js (next-right-now is way too opinionated). I've followed the latest example exactly and am still getting the |
@5tormTrooper This error usually occurs when you did not wrap your custom webpack config in the https://github.com/UnlyEd/next-right-now/blob/master/next.config.js#L8 Currently only the |
@5tormTrooper I don't know when you looked at NRN, and you're right it's opinionated but I'm currently working on different "presets", the goal being to release different presets with different built-in features, and eventually end up with a "simple" preset with the minimal stuff for easier re-use and avoid "too much opinions". Read more at https://unlyed.github.io/next-right-now/concepts/presets I've had my hands full due to COVID-19 crisis, but I'll definitely release simpler presets at some point. |
Thanks for the responses. @Vadorequest simpler presets would be awesome :) My install is based off this starter btw. |
This could be useful: https://docs.sentry.io/platforms/javascript/guides/nextjs/#configure if you notice while on local, running that command I think one needs to ensure this file is available also in production 🤔 and you will be good to go in your build runs. ✔️ |
@robertkibet I'm facing the same as .sentryclirc file is added in .gitignore and vercel build is getting failed cuz there is not auth.token there. now I've added env var on vercel for sentry auth token and it works well. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
The
readme.md
of the example states it works on the server-side.This is a simple example showing how to use Sentry to catch & report errors on both client + server-side.
However, The example using
@sentry/browser
which doesn't work on the server (node environment)Where can I simple alternative for using sentry on the server-side? the other example
with-sentry
seems too complicated.for some reason import
@sentry/node
(latest version) in a simple nextjs project is met with an errorThe text was updated successfully, but these errors were encountered: