react-icons / react-icons/react-icons

No export named 'GenIcon' using Vite build tool

Open
#383 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
12.7k
Forks
809
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I ran into this error:

Uncaught SyntaxError: The requested module '/@modules/react-icons/lib/cjs/index.js' does not provide an export named 'GenIcon'

When trying to import an icon in my newly scaffolded Vite app:

import React, { useState } from 'react'
import logo from './logo.svg'
import './App.css'
import { FaBeer } from 'react-icons/fa'

function App() {
  const [count, setCount] = useState(0)

  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>Hello Vite + React!</p>
        <p>
          <button onClick={() => setCount(count => count + 1)}>count is: {count}</button>
        </p>
        <p>
          Edit <code>App.tsx</code> and save to test HMR updates. <FaBeer/>
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  )
}

export default App

Expected behavior
no error.

Additional context
Using Vite with template react-ts.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the error from the newly scaffolded Vite react-ts app shown in App.tsx, starting with the FaBeer import and the reported /@modules/react-icons/lib/cjs/index.js entry. Inspect how the package exposes GenIcon during Vite loading; done when the sample app imports FaBeer without the export error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.