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

[Bug?]: Loading a lot of chunks when adding @tabler/icons to the project #11704

Closed
1 task
j-tag opened this issue Oct 20, 2024 · 2 comments
Closed
1 task

[Bug?]: Loading a lot of chunks when adding @tabler/icons to the project #11704

j-tag opened this issue Oct 20, 2024 · 2 comments
Labels
bug/needs-info More information is needed for reproduction

Comments

@j-tag
Copy link

j-tag commented Oct 20, 2024

What's not working?

After upgrading to redwood 8, having tabler icons in any pages will cause redwood to load a lot of chunks which will slows down (and sometimes crashes) the browser.

Here you can see a lot of chunks are loaded for just one tabler icon:

Screenshot_20241020_225112

This behavior wasn't present on redwood 7, that's why I opened this bug report here for redwood instead of tabler icons.

How do we reproduce the bug?

to reproduce the bug you can do the following:

yarn create redwood-app my-redwood-project --typescript
cd ./my-redwood-project/
yarn workspace web add @tabler/icons-react
rw g page HomePage

then you should open up web/src/pages/HomePage/HomePage.tsx and import any icon from tabler icons:

import { IconHome } from '@tabler/icons-react'

then you can use this icon inside page content:

//...
<h1>HomePage</h1>

<span><IconHome style={{ width: 13, height: 13 }} /></span>

<p>
        Find me in <code>./web/src/pages/HomePage/HomePage.tsx</code>
</p>
//...

now if you run dev server and open up home page, you can see in your dev console that a lot of chunks are being loaded.

rw dev

What's your environment? (If it applies)

❯ rw info

  System:
    OS: Linux 6.11 Arch Linux
    Shell: 3.7.1 - /usr/bin/fish
  Binaries:
    Node: 20.18.0 - /tmp/xfs-de75df9f/node
    Yarn: 4.4.0 - /tmp/xfs-de75df9f/yarn
  Databases:
    SQLite: 3.46.1 - /usr/bin/sqlite3
  npmPackages:
    @redwoodjs/core: 8.4.0 => 8.4.0 
    @redwoodjs/project-config: 8.4.0 => 8.4.0 
  redwood.toml:
    [web]
      title = "Redwood App"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = true
    [notifications]
      versionUpdates = ["latest"]

Are you interested in working on this?

  • I'm interested in working on this
@j-tag j-tag added the bug/needs-info More information is needed for reproduction label Oct 20, 2024
@ArseniiLyzenko
Copy link

@j-tag
Copy link
Author

j-tag commented Nov 10, 2024

Thanks @ArseniiLyzenko for the workaround. Saved me a lot of headaches. So it seems the problem comes from Vite and Tabler icons and is not related to Redwoodjs. So I'm closing this issue.

@j-tag j-tag closed this as completed Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

2 participants