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

fix(nextjs): Add back browser field in package.json #6809

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Jan 16, 2023

Fixes #6808

Some build pipelines that run outside of Next.js look at the browser field in the package.json to import package code that is intended for the browser.

With #6753 we removed the browser field, thinking it wasn't necessary, breaking tooling like Storybook which now imported Node code.

This PR adds back the browser field, but we need to add another multiplexer entry point because Next.js will also look at the browser field to import SDK code for the Edge runtime.

@lforst lforst self-assigned this Jan 16, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.82 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 61.44 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.49 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.74 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.22 KB (0%)
@sentry/browser - Webpack (minified) 66.17 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.24 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.51 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.73 KB (+0.03% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.01 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.11 KB (-0.83% 🔽)
@sentry/replay - Webpack (gzipped + minified) 38.45 KB (-0.99% 🔽)

@lforst lforst merged commit 7f22f5d into master Jan 17, 2023
@lforst lforst deleted the lforst-fix-non-nextjs-build-pipelines branch January 17, 2023 09:04
@ezhlobo
Copy link

ezhlobo commented Jan 17, 2023

@lforst thank you for fixing this, could you please drop a line here when and in what version it's published to npm? 🙏

@lforst
Copy link
Member Author

lforst commented Jan 17, 2023

@ezhlobo The new release is out! https://github.com/getsentry/sentry-javascript/releases/tag/7.31.1 Let me know if it resolves the issue for you!

@ezhlobo
Copy link

ezhlobo commented Jan 18, 2023

@lforst yes, it works well now! Thank you very much for a very quick fix and for notifying me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@sentry/next.js 7.31 breaks Storybook build
3 participants