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

Babel Optimization Error: Module Size Exceeding 500KB #61

Open
0-don opened this issue Mar 18, 2024 · 2 comments
Open

Babel Optimization Error: Module Size Exceeding 500KB #61

0-don opened this issue Mar 18, 2024 · 2 comments

Comments

@0-don
Copy link

0-don commented Mar 18, 2024

Description

When building a SolidJS project using solid-icons, Babel throws an optimization error indicating that the styling of some modules exceeds the maximum size of 500KB. This is occurring specifically with solid-icons/fa/index.js and solid-icons/tb/index.js. The error message is repeated multiple times, suggesting that the issue persists through multiple attempts to compile.

Steps to Reproduce

  1. Set up a SolidJS project with @solidjs/start.
  2. Include the solid-icons package in the dependencies.
  3. Run the build script.

Expected Behavior

The build should complete without errors, and Babel should handle the module size appropriately, possibly by splitting or tree-shaking.

Actual Behavior

The following error is received:

[BABEL] Note: The code generator has deoptimised the styling of /home/don/MEGA/Projects/coding.global-web/node_modules/solid-icons/tb/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/don/MEGA/Projects/coding.global-web/node_modules/solid-icons/fa/index.js as it exceeds the max of 500KB.

Environment

  • SolidJS Version: 1.8.15
  • Solid Icons Version: 1.1.0
  • Node Version: 20
  • Package Manager: [yarn]
  • Operating System: [Linux]

Possible Solution

Could this be an issue with how the icons are being imported or bundled? Is there a recommended way to import solid-icons that could avoid this problem?

Additional Context

image

@x64Bits
Copy link
Owner

x64Bits commented Mar 22, 2024

Hi @0-don thanks for sharing, solid-start receive new updates recently, i will check this and go back with update soon.

@sparklog
Copy link

sparklog commented May 5, 2024

In dev mode, Babel shows the error as above. However, when I built it, app works well. I think 'tree shake' function solved this issue during the build process. Am I right?

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

No branches or pull requests

3 participants