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
@phosphor-icons/react doesn't have support for modules, only CommonJS #59
Comments
What version are you using? What environment and tooling? We do expose both ES and UMD builds with |
@rektdeckard PACKAGE.JSON
TSCONFIG.JSON
|
You may have to change the |
Have added |
Live on stable versions |
I was using
phosphor-react
on my NPM pakcage, and I want to migrate to@phosphor-icons/react
, so I can get more icons.On my package, there is a file
src/icons/index.ts
where I just export the icons from Phosphor. Withphosphor-react
, it was working:But when I change to
@phosphor-icons/react
, it gives me the following error message:TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@phosphor-icons/react")' call instead. To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field
"type": "module"to 'C:/Users/roich/dev/bioma/bioma-ui/lib/package.json'.
I tried to change the file name to
index.mts
and add the"type": "module"
to my package.json, and none of them were the solution I was looking for.I suggest this new package supports both CommonJS format and ECMAScript modules.
The text was updated successfully, but these errors were encountered: