Skip to content

Issue: Vike + @tabler/icons-react Breaks Dev Mode REACT #1344

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

Open
4 tasks done
br0wsa opened this issue Apr 3, 2025 · 2 comments
Open
4 tasks done

Issue: Vike + @tabler/icons-react Breaks Dev Mode REACT #1344

br0wsa opened this issue Apr 3, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@br0wsa
Copy link

br0wsa commented Apr 3, 2025

Icon name

all

Use cases

all

Design ideas

Issue: Vike + @tabler/icons-react Breaks Dev Mode

Description

When using Vike with React (vike-react) and the @tabler/icons-react package (^3.31.0), the development mode breaks after importing any icon into a component. Vite starts loading all the icon chunks, which causes a significant delay (about 10 seconds on my machine). The issue does not occur during the build process or when running the app in preview mode.

Reproduction

  1. Install the following packages:
    • "vike": "^0.4.225"
    • "vike-cloudflare": "^0.1.7"
    • "vike-react": "^0.6.1"
    • "vite": "^6.2.2"
    • "@tabler/icons-react": "^3.31.0"
  2. Import any icon from @tabler/icons-react in a component, e.g.:
    import { Home } from '@tabler/icons-react';

Temporary Workaround

As a temporary solution, adding the following configuration to vite.config.ts resolves the issue:

`import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
resolve: {
alias: {
// Add this alias to solve the issue temporarily
'@tabler/icons-react': '@tabler/icons-react/dist/esm/icons/index.mjs',
},
},
});
`

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.)
  • I have searched existing icons to make sure it does not already exist and I didn't find any.
  • I am not requesting a brand logo and the art is not protected by copyright.
  • I have provided appropriate use cases for the icon(s) requested.
@br0wsa br0wsa added the icon request New icon or icon update requested label Apr 3, 2025
@DanielGibbsNZ
Copy link

DanielGibbsNZ commented Apr 12, 2025

I believe this is a duplicate of #1233. Some other workarounds include importing the icons directly (see here) or pinning the package version to 3.17.0 or earlier (if you don't need any of the more recent icons).

@taivo
Copy link

taivo commented Apr 16, 2025

Looks like the same is happening with solidstart with vite in dev mode

@ethancrawford ethancrawford added bug Something isn't working and removed icon request New icon or icon update requested labels Apr 29, 2025
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

4 participants