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

Tree shaking not working with Next.js 14, 15 & React 18; Request support for React 19 #13196

Open
nguyenvanhieu1996 opened this issue Feb 12, 2025 · 0 comments
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@nguyenvanhieu1996
Copy link

Summary

Tree shaking does not seem to be working when using Next.js 14, 15 with React 18. This issue causes unnecessary bundle size increases and potential performance issues.
Additionally, we would like to request support for React 19 in future releases.

Next.js Version: 14.2.24 / 15.1.7
React Version: 18.2.0
Polaris Version: 13.9.2 (latest)
Build Tool: Webpack 5.97.1

Expected behavior

Tree shaking should properly remove unused code when using Next.js 14, 15.
React 19 should be officially supported.

Actual behavior

Unused components and utilities are not being eliminated during build time.
Performance may be affected due to larger bundle sizes.

Steps to reproduce

Set up a new Next.js 14 or 15 project with React 18.
Install @shopify/polaris and import specific components.
Check the final bundle size with Webpack.
Observe that tree shaking is not working as expected.

If relevant, provide code snippets or configurations.

Are you using React components?

None

Polaris version number

No response

Browser

No response

Device

No response

@nguyenvanhieu1996 nguyenvanhieu1996 added Bug Something is broken and not working as intended in the system. untriaged labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

No branches or pull requests

1 participant