Skip to content

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

Merged
lforst merged 4 commits into
masterfrom
lforst-fix-non-nextjs-build-pipelines
Jan 17, 2023
Merged

fix(nextjs): Add back browser field in package.json#6809
lforst merged 4 commits into
masterfrom
lforst-fix-non-nextjs-build-pipelines

Conversation

@lforst

Copy link
Copy Markdown
Contributor

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.

@lforstlforst self-assigned this Jan 16, 2023
@github-actions

github-actionsBot commented Jan 16, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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 masterJan 17, 2023
@lforst
lforst deleted the lforst-fix-non-nextjs-build-pipelines branch January 17, 2023 09:04
@ezhlobo

Copy link
Copy Markdown

@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
Copy Markdown
ContributorAuthor

@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
Copy Markdown

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

Sign up for freeto 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

@lforst@ezhlobo@Lms24