Closed danielluca closed 9 months ago
Yep. You've discovered namespace collision! This isn't a bug, it's just a reality of the JS ecosystem. We can't know all the global variable names for all environments, so import aliasing (import { X as AliasedX } from "module";
) is the correct solution here, as opposed to trying to rename icons to try to avoid this.
There's an argument to be made that Infinity
is special because it's a numeric global present in all environments, but in reality there are lots of these. On web, for example, all these icon names are also things present on the global object:
I'm closing this because we don't plan to rename these icons, and your solution is the one we expect devs to arrive at on their own.
Describe the bug By using the Icon my whole page will not render
To Reproduce Steps to reproduce the behavior:
Import Infinity from '@phosphor-icons/react'
<Infinity/>
componentExpected behavior Icon is rendered and page is working
Screenshots![CleanShot 2023-10-09 at 11 14 17](https://github.com/phosphor-icons/homepage/assets/13754192/b86dd979-2ff8-4e6c-9d39-9992d8b6662e)
Desktop (please complete the following information):
Additional context Error happens after updating to Next 13.2.4. Solution is to redeclare the component name.
import Infinity as InfinityIcon from '@phosphor-icons/react'