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
TypeError: Cannot create property 'displayName' on number 'Infinity' #79
Comments
Just use import aliasing to rename it to whatever you want. We have addressed this one before, and import { Infinity as InfinityIcon } from "@phosphor-icons/react”; |
The error occurs during compilation (or should I say in the compiled/built code) independent of whether I'm using the icon or not. Currently, I am not using the icon, I don't have it imported anywhere.
That's not good practice, IMO. And even if the global must be "reused" (overridden), then they should, at least, have the same base (data) type. Now, the compiler sees |
We're running into the same issue, @power-f-GOD did you find a workaround? 🙏🏼 |
We've decided to rename the icon |
@power-f-GOD to clarify what I meant, we will be careful not to use global names internally, but it should not matter if we provided aliased named exports that occasionally conflict with globals. |
Thanks @rektdeckard ! Let's hope it helps 🤞🏼 As @power-f-GOD mentioned, even if the icon is not used, the error occurs during compilation (in our case, during Jest test runs). Let's see! 🥁 |
Try upgrading to |
Infinity
is anumber
(and/or reserved word) in JavaScript, hence theInfinity
icon's name conflicts with the same.This makes my NextJS (14) app build break.
The text was updated successfully, but these errors were encountered: