-
-
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
Cannot destructure property 'RawSource' of 'require(...)' as it is undefined error only when withSentryConfig is used and a site is viewed in Next dev mode #8541
Comments
Hey @philwolstenholme, thanks for writing in. I think our SDK has some issues with Next If you downgrade your Next version, do you still get errors? |
Does not happen after downgrading, this is only happening on 13.4.10 (somewhere after 13.4.10-canary.2 that I tested with before) |
We're still investigating what the issue here is - but if anyone has any ideas/suggestions they're greatly appreciated! |
i have the same problem, it happens in 13.4.10 v |
I'm having the same problem with next 13.4.7 |
I've been experiencing this issue since bumping my libs from Next
edit: oops, ignore my previous message. I'd forgotten to remove the caret in The issue is gone after pinning versions and using Sentry |
this throws the error: Error: Cannot find module 'webpack' by the way, all these is after production has been built and started |
I can also confirm downgrading Next |
I had the same issue and downgraded Next.js to |
can confirm |
Hello If you upgrade to sentry 7.58.1 and Next.js 13.4.9, the error issue disappears |
Hi all, quick update: We still believe the issue is not related to a specific, recent, Sentry SDK version but just to the latest Next We have a somewhat ugly hotfix (#8543) to work around this but I'm not too happy with it, given that we don't know the root cause. That being said, if anyone has an idea what specific change in NextJS might cause the import of |
Does that mean Next prod doesn't have this issue? Haven't tested yet
myself.
…On Mon, 17 Jul 2023, 11:05 Lukas Stracke, ***@***.***> wrote:
Hi all, quick update: We still believe the issue is not related to a
specific, recent, Sentry SDK version but just to the latest Next 13.4.10
version. Going back to 13.4.9 fixes this issue regardless of the Sentry
SDK version.
We have a somewhat ugly hotfix (#8543
<#8543>) to work
around this but I'm not too happy with it, given that we don't know the
root cause. That being said, if anyone has an idea what specific change in
NextJS might cause the import of @sentry/webpack-plugin to suddenly fail
during dev mode, please let us know :)
—
Reply to this email directly, view it on GitHub
<#8541 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE7SAKQF3UA24GDAWH6C43XQT55RANCNFSM6AAAAAA2KQ4ZDM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
You mean Just noticed that this issue was also raised in the NextJS repo: |
As reported in #8541, our NextJS SDK currently breaks dev mode for the newest NextJS 13.4.10 version I have absolutely no idea which of the changes in [13.4.10](https://github.com/vercel/next.js/releases/tag/v13.4.10) is causing this. However, I traced the error back and it happens as soon as our NextJS SDK package requires @sentry/webpack-plugin: * @sentry/nextjs calls `require('@sentry/webpack-plugin')` * @sentry/webpack-plugin calls `const { RawSource } = require('webpack-sources');` * For _whatever_ reason, NextJS can't require `webpack-sources` and throws 💥 Since we don't enable our Webpack plugin [in dev mode](https://github.com/getsentry/sentry-javascript/blob/723f851f358b75cd39da353804c51ff27ebb0c11/packages/nextjs/src/config/webpack.ts#L305) anyway, one way to get rid of this error is to only require it if we're _not_ in dev mode. This hotfix therefore moves the top-level require of `@sentry/webpack-plugin` to a dynamic require. This isn't a great solution and honestly quite ugly but if it unblocks users for now I'd say we merge it. I think we should definitely revisit this though once we know more about why NextJS suddenly isn't able to import `webpack-sources`. ref #8541
with this nextjs version, i have noticed the sentry version that works with it is @sentry/nextjs =7.57.0 |
To everyone following this thread: We just released a beta version with the aforementioned hotfix. If you can, please help us out and update to |
It might just be an issue with The error doesnt point me to anything useful and might not even be connected to this issue. But it started happening after the update. https://codesandbox.io/p/sandbox/elated-lake-m6hgwd EDIT: Im sorry, the more i look at it it seems like its not a sentry thing. Ill take it up with next or emoji-mart :) |
Well, seems at least we're not the only ones that who were once again broken by next 😅 thanks for investigating @kirkegaard!
Yes, that's correct 🤞 |
I get the same issue as @0x80 on @sentry/next.js 7.59.3:
|
Comment from nextjs team: vercel/next.js#52620 (comment) |
Any progress here? |
Anyway, IMHO this issue is not related to the original bug report Shouldn't be error from #wmadden discussed in another thread and close this issue? |
Yes @jandolezal71 , the original issue was solved in |
@jandolezal71 You were right, we have a package in our monorepo with a dependency on @sentry/[email protected]. Updating this to 1.20.0 fixed the issue. Thanks for your help! |
Great. Thanks for the update! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.58.1
Framework Version
13.4.10
Link to Sentry event
No response
SDK Setup
next.config.js
:Steps to Reproduce
I'm sorry, I don't have a minimum viable reproduction for this, and it's a private repo. I can try and put something together next week perhaps, but I wanted to raise this issue in case one of the maintainers recognised the issue.
My environment:
Expected Result
Site can be viewed in dev mode
Actual Result
Site errors when a page is viewed in dev mode when
withSentryConfig
is used, but works whenwithSentryConfig
is not used.The text was updated successfully, but these errors were encountered: