You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typescript projects using the moduleResolution NodeNext or node16 cannot consume @primer/octicons-react 19.9.0 (and transitively @primer/react36.13.0, regressing from 36.12.0) since the icons type definition is not imported with a file extension.
The import will just fail and, when peeking into the index.d.mts, you'll find the error:
relative import paths need explicit file extensions in ecmascript imports
Patch that worked for me on dist:
diff --git a/dist/index.d.mts b/dist/index.d.mts
index acfe71a1ce71b4764c3d155334b3bbc2830ea5d0..8539c08534ff1732a8f80c3ba850dfd6cc7f4ac8 100644
--- a/dist/index.d.mts+++ b/dist/index.d.mts@@ -2,7 +2,7 @@
import * as React from 'react'
// eslint-disable-next-line prettier/prettier
-import { Icon } from './icons'+import { Icon } from './icons.js'
type Size = 'small' | 'medium' | 'large'
@@ -20,4 +20,4 @@ export interface OcticonProps {
verticalAlign?: 'middle' | 'text-bottom' | 'text-top' | 'top' | 'unset'
}
-export * from './icons'+export * from './icons.js'
Typescript projects using the moduleResolution
NodeNext
ornode16
cannot consume@primer/octicons-react
19.9.0 (and transitively@primer/react
36.13.0, regressing from 36.12.0) since the icons type definition is not imported with a file extension.The import will just fail and, when peeking into the index.d.mts, you'll find the error:
Patch that worked for me on dist:
I guess it's just https://github.com/primer/octicons/blob/main/lib/octicons_react/src/index.d.ts
The text was updated successfully, but these errors were encountered: