-
-
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
@sentry/nextjs
throws withSentry is not a function
#3750
Comments
Hi, @Vadorequest. I've pinged you in other issues about various things, so forgive me if some of this is repetition - I just want there to be an answer in case anyone else lands here in the future. I tried running your repro code and got the following:
so I wasn't able to play around with it. That said, I see that this is from a few versions ago, and some of the comments in the code of that PR reference issues in this repo which are now closed. Can you please confirm if you're still having this particular issue when using the latest version of the SDK? You should be able to eliminate most of the sentry-related boilerplate in your example above - the Please let me know! |
I got the same error when I implemented the API route in a slightly different pattern than normal. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
I still have this issue as @ka2n and @Vadorequest mentioned. I can reproduce with latest packages ├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
└─ @sentry/[email protected] |
I didn't take the time to follow-up on #3750 (comment) comment, but as far as I know it hasn't been solved for me either. (I didn't try since last time, though) |
@lobsterkatie I think you tried to clone at a time when GitHub was down. It works fine for me, and the repository has always been public so it shouldn't be an issue to clone any branch.
|
Likely related to #3673. |
A lot of work has happened into the |
@vladanpaunovic The related issue I linked seems still to be active, so this one may be as well. @ka2n, I suspect you may still be running into this, because your repro app above (thanks for that!) is set up somewhat like the repro in that issue, in that you're calling a function from Now that I'm thinking about it, I does make (some) sense. (I saw your docstring, but I don't think it's correct. When I build your app (using The handler's been anonymized, but it's still there.) Regardless, I tried moving I'm considering adding a note to the docs about this, but before I do, I want to get a sense of how common a use case this is. Is setting it up that way something you came to on your own, or were you following a guide of some sort? |
@lobsterkatie I'm sorry for the short response. |
Got it, thanks. I'm going to close this then, as it seems like we've come to a working solution. Cheers! |
I can reproduce these error. and still showed with the last version of sentry. For reproducing use the simple implementation of sentry: https://github.com/zodman/nextjs-with-sentry The problem is in my case when you export a variable in the API directory https://github.com/zodman/nextjs-with-sentry/blob/main/pages/api/test1.js#L3 and reuse on the pages: long story short .. you mixing the backend with the frontend ... |
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
Using
Sentry.withSentry
fails using"@sentry/nextjs": "6.7.2"
, I tried other versions, but the results were the same.Source code is open source and available at UnlyEd/next-right-now#370.
Reproduction:
git clone [email protected]:UnlyEd/next-right-now.git nrn-next-sentry && cd nrn-next-sentry && git checkout next-sentry && cp .env.local.example .env.local && yarn && yarn start
The text was updated successfully, but these errors were encountered: