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

Vite dev mode loads all icon chunks with 3.19.0 (React) #1233

Open
4 of 30 tasks
dcentrih opened this issue Sep 28, 2024 · 24 comments
Open
4 of 30 tasks

Vite dev mode loads all icon chunks with 3.19.0 (React) #1233

dcentrih opened this issue Sep 28, 2024 · 24 comments
Labels
bug Something isn't working

Comments

@dcentrih
Copy link

Description

Using the new 3.19.0 version of the react package breaks dev mode.
After importing any one icon into a component, vite will start loading all the icon chunks (takes about 10 seconds on my machine).
Building the app does not have this issue (preview mode).

image

Package

  • @tabler/icons
  • @tabler/icons-eps
  • @tabler/icons-pdf
  • @tabler/icons-png
  • @tabler/icons-webfont
  • @tabler/icons-sprite
  • @tabler/icons-preact
  • @tabler/icons-react
  • @tabler/icons-react-native
  • @tabler/icons-solid
  • @tabler/icons-svelte
  • @tabler/icons-vue
  • Figma plugin
  • source/main
  • other/not relevant

Version

3.19.0

Browser

  • Chrome/Chromium
  • Firefox
  • Safari
  • Edge
  • iOS Safari
  • Opera
  • Other/not relevant

Operating system

  • Windows
  • Linux
  • macOS
  • ChromeOS
  • iOS
  • Android
  • Other/not relevant

Steps to reproduce

  1. Import any icon
    import { IconComponents, IconTag } from "@tabler/icons-react";
  2. Run vite in dev mode

Checklist

  • I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)
@dcentrih dcentrih added the bug Something isn't working label Sep 28, 2024
@fnoopv
Copy link

fnoopv commented Sep 29, 2024

+1

1 similar comment
@adnanfajlur
Copy link

+1

@AhmedHHamdy
Copy link

AhmedHHamdy commented Sep 29, 2024

+1
image

@ciro-maciel
Copy link

+1

2 similar comments
@Kevin-Saukel-Git
Copy link

+1

@amankrokx
Copy link

+1

@noah-franklin
Copy link

was losing my mind over why vite was taking 5 years to load initially, I guess something broke tree shaking in 3.19

@Reynard-G
Copy link

+1

@dougfrei
Copy link

dougfrei commented Oct 2, 2024

It seems like something with [email protected] is causing this problem. I checked down to @tabler/[email protected] and still had issues with all the icon chunks loading in dev mode. After downgrading to [email protected] the excess chunk loading was gone, even when using @tabler/[email protected].

@Cararr
Copy link

Cararr commented Oct 2, 2024

It almost blew my pc.

@pavel-pargachev
Copy link

It has something to do with the new "Dynamic Icons Import" feature released with 3.19.0 (#1081).

When I commented out 2 lines related to this feature from tabler-icons-react.mjs file - the loading of chunks by vite dev went to normal again:
image

@enyelsequeira
Copy link

anyone found a solution yet? downgrading perhaps? or is there a better one?

@ciro-maciel
Copy link

ciro-maciel commented Oct 2, 2024

for now, I forced the installation to:

"@tabler/icons-react": "3.17.0",
"vite": "5.4.8",

I cleaned the environment,

rm -rf node_modules bun.lockb package-lock.json dist

I installed everything again and it worked fine here

CleanShot 2024-10-02 at 15 23 22

@amankrokx
Copy link

for now, I forced the installation to:

"@tabler/icons-react": "3.17.0",
"vite": "5.4.8",

@ciro-maciel any specific reason for not using 3.18.0 ? I'm using that.

@enyelsequeira
Copy link

for now, I forced the installation to:

"@tabler/icons-react": "3.17.0",
"vite": "5.4.8",

I cleaned the environment,

rm -rf node_modules bun.lockb package-lock.json dist

I installed everything again and it worked fine here

CleanShot 2024-10-02 at 15 23 22

Same here ended up locking the correct one, I’m using it with mantine so I’m using that version

@ciro-maciel
Copy link

for now, I forced the installation to:

"@tabler/icons-react": "3.17.0",
"vite": "5.4.8",

@ciro-maciel any specific reason for not using 3.18.0 ? I'm using that.

I tested with 3.18.0 and got the error... so I used 3.17.0 and I'm not getting the error

@lukasbash
Copy link

This not only affects the DEV mode. It also affects the production bundle. Even more critical because it's a silent failure.
image

@astalarico
Copy link

+1

@mathiaswillburger
Copy link

mathiaswillburger commented Oct 9, 2024

same issue, forcing the package to "@tabler/icons-react": "3.17.0" solved the problem for now and speeds up the vite dev application load tremendously again

@KevinVandy
Copy link

@codecalm @timheerwagen Any chance this gets fixed? Kind of afraid that in order to fix this for mantine-react-table, I'll have to just embed the svgs in the codebase instead of using tabler as a peer dep. KevinVandy/mantine-react-table#418

@KevinVandy
Copy link

KevinVandy commented Oct 14, 2024

This not only affects the DEV mode. It also affects the production bundle. Even more critical because it's a silent failure.

@lukasbash

All other reports are that in only affects DEV mode and not production bundles. Could you share what kind of build config that application has? Older webpack?

If true, this is way more serious than I initially thought, as it would be potentially quadrupling the bundle size of some apps for unused icons.

@lukasbash
Copy link

This not only affects the DEV mode. It also affects the production bundle. Even more critical because it's a silent failure.

@lukasbash

All other reports are that in only affects DEV mode and not production bundles. Could you share what kind of build config that application has? Older webpack?

If true, this is way more serious than I initially thought, as it would be potentially quadrupling the bundle size of some apps for unused icons.

Might be I got this wrong but I am simply performing a bundle analyzer call on the latest vite version.

In my case I am using bun:
bunx vite-bundle-visualizer

@AstroCaleb
Copy link

Glad I found this thread! I updated deps last night before launching a new project and noticed dev mode started taking the same ~10 seconds others have described. Forcing "@tabler/icons-react": "3.17.0" also worked for me, running with latest vite (5.4.9) and everything. I even tested with [email protected] and [email protected], based on a comment above, and still noticed the chunks issue. It seems, at least for me, [email protected] is the only change I needed to change.

@baberMatt
Copy link

+1 same issue as described by many in my Remix(vite) vercel app. Will try versioning down

BANANAPEEL202 added a commit to hytech-racing/query-frontend that referenced this issue Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests