primer / octicons

A scalable set of icons handcrafted with <3 by GitHub
https://primer.style/foundations/icons
MIT License
8.29k stars 827 forks source link

[Bug] @primer/octicons-react `esm` is incorrectly exported #1006

Closed steven89 closed 6 months ago

steven89 commented 8 months ago

Describe the bug

package.json is misconfigured regarding esm/cjs exports, resulting in the .esm.js file being loaded as a commonjs module and failing in nodejs environment.

https://publint.dev/@primer/octicons-react@19.8.0

Steps to reproduce

import this module in a server-side rendering environment results in the following error:

/.../node_modules/@primer/octicons-react/dist/index.esm.js:1
import React from 'react';
^^^^^^

SyntaxError: Cannot use import statement outside a module

Expected behavior

package.json should either: