Skip to content
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

withSentryConfig breaks unstable_allowDynamic #8386

Closed
3 tasks done
grantmagdanz opened this issue Jun 22, 2023 · 4 comments
Closed
3 tasks done

withSentryConfig breaks unstable_allowDynamic #8386

grantmagdanz opened this issue Jun 22, 2023 · 4 comments
Assignees
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug

Comments

@grantmagdanz
Copy link

grantmagdanz commented Jun 22, 2023

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.56.0

Framework Version

next 13.4.6

Link to Sentry event

No response

SDK Setup

You can find a simple repo with the setup here: https://github.com/grantmagdanz/sentry-unstable_allowDynamic-repro

Steps to Reproduce

  1. Clone https://github.com/grantmagdanz/sentry-unstable_allowDynamic-repro
  2. Run yarn build and see the error
  3. Set skipSentry = true in next.config.js
  4. Run yarn build again and see the build success correctly

I instrumented the next code and it looks like withSentryConfig is doing something that messes up the routes. At this check, route is null so unstable_allowDynamic doesn't exist

Expected Result

Build succeeds. More info on unstable_allowDynamic here.

Actual Result

Build fails:

$ yarn build

yarn run v1.22.19
$ next build
- info Linting and checking validity of types  
- warn You are using an experimental edge runtime, the API might change.
error - No Sentry organization slug configured. Source maps will not be uploaded.
To fix this, set the SENTRY_ORG environment variable to the to your organization slug during the build.

Failed to compile.

./node_modules/lodash/lodash.js
Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime 
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation

Import trace for requested module:
./node_modules/lodash/lodash.js


> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@lforst
Copy link
Member

lforst commented Jun 23, 2023

Thanks for raising this!

I just tested this with the latest state of our develop branch and the error you shared didn't occur. We did some changes between the latest release and now so maybe this is already fixed.

@lforst lforst added the Package: nextjs Issues related to the Sentry Nextjs SDK label Jun 23, 2023
@grantmagdanz
Copy link
Author

That's great news. Any idea when that will ship?

@lforst
Copy link
Member

lforst commented Jun 23, 2023

@grantmagdanz Likely next week!

@PfisterFactor
Copy link

I can confirm this is fixed in 7.64.0

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 Type: Bug
Projects
Archived in project
Development

No branches or pull requests

3 participants