Skip to content

Default import of Icon crushes production build #87

@deslancer

Description

@deslancer

When I use icons like import Icon from "@mdi/react"; it crushes production build,
I have get errors like : Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
After a long search for a solution, I noticed that the problem was the default import of the icon
So, if anyone encounters same errors, try to change default import od Icon to named :
import Icon from '@mdi/react'; -> import {Icon} from '@mdi/react';

My setup:

  • React-18.2.0
  • Typescript-4.9.5
  • Vite-4.0.1
  • Vitest-0.25.8
  • nx-15.6.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions