The package.json of the @callstack/polygen package use types or require as exports condition for all its exports, it should either dual-publish ESM files or use default instead of require:
|
"exports": { |
|
".": { |
|
"types": "./dist/index.d.ts", |
|
"require": "./dist/index.js" |
|
}, |
|
"./polyfill": { |
|
"types": "./dist/polyfill.d.ts", |
|
"require": "./dist/polyfill.js" |
|
}, |
|
"./config": { |
|
"types": "./dist/config.d.ts", |
|
"require": "./dist/config.js" |
|
}, |
|
"./package.json": "./package.json" |
|
}, |
With the current situation, the latest version of Expo (SDK 53) and Metro (0.82.4) fails to import the polyfill:
iOS Bundling failed 271ms example/index.ts (549 modules)
Unable to resolve "@callstack/polygen/polyfill" from "example/App.tsx"
I suggest declaring the package "type": "commonjs" too.
The
package.jsonof the@callstack/polygenpackage usetypesorrequireas exports condition for all its exports, it should either dual-publish ESM files or usedefaultinstead ofrequire:polygen/packages/polygen/package.json
Lines 10 to 24 in 0d0a255
With the current situation, the latest version of Expo (SDK 53) and Metro (0.82.4) fails to import the polyfill:
I suggest declaring the package
"type": "commonjs"too.