Skip to content

Webpack plugin incompatibility between @sentry/nextjs and next-plugin-preval #3848

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

Closed
Vadorequest opened this issue Jun 10, 2021 · 3 comments · Fixed by #3698
Closed

Webpack plugin incompatibility between @sentry/nextjs and next-plugin-preval #3848

Vadorequest opened this issue Jun 10, 2021 · 3 comments · Fixed by #3698
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@Vadorequest
Copy link

Issue

This an issue with:

Platform/SDK documentation (Which one?)
https://docs.sentry.io/platforms/javascript/guides/nextjs/
Sentry Product (Which area?)
nextjs

Description

ricokahler/next-plugin-preval#42

Suggested Solution

I'm not sure if you'd want to look into it, adapt the doc, etc. I don't know from what plugin the issue comes from.

@getsentry-release
Copy link

Routing to @getsentry/team-webplatform for triage. ⏲️

@Vadorequest
Copy link
Author

Vadorequest commented Jun 10, 2021

The author of the other lib has identified the issue coming from @sentry/next, which doesn't seem to handle all potential inputs (object and function), which leads to this error.

See ricokahler/next-plugin-preval#42 (comment)

It should be noted this will affect many other plugins, it's not specific to that one in particular.

@lobsterkatie
Copy link
Member

lobsterkatie commented Jun 14, 2021

Yes - this is a known problem, slated for fixing this sprint. Thanks for checking in with the preval folks.

lobsterkatie referenced this issue Jun 29, 2021
…ype (#3760)

When fixing https://github.com/getsentry/sentry-docs/issues/3723, the return type of `withSentryConfig` was changed from an object to a function which returns an object, since otherwise there's no way to get the `phase` and `defaultConfig` arguments needed when the user passes their existing nextjs config as a function.

If users follow our instructions in https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/, and export `withSentryConfig(...)` with no further modifications, this is an invisible change, since they're never dealing with its return value. But for any who do further process said value, it turns out to have been a potentially breaking change.

This reverts to the old behavior (of returning an object) in cases where the existing config is an object, and only returns a function when necessary, which is to say, when the existing config is itself a function.

Fixes #3722.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2021
@getsentry getsentry unlocked this conversation Jul 29, 2021
@lobsterkatie lobsterkatie transferred this issue from getsentry/sentry-docs Jul 29, 2021
@lobsterkatie lobsterkatie added Package: nextjs Issues related to the Sentry Nextjs SDK Status: Fixed and removed Status: Untriaged labels Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants