Skip to content
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

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

Closed
steven89 opened this issue Feb 8, 2024 · 0 comments · Fixed by #1008
Closed

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

steven89 opened this issue Feb 8, 2024 · 0 comments · Fixed by #1008
Labels

Comments

@steven89
Copy link

steven89 commented Feb 8, 2024

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/[email protected]

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:

  • have a "type": "commonjs" attribute and export the ES module as .mjs
  • have a "type": "module" attribute and export the commonjs as .cjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant