With a clean create-expo-app I added iconoir-react-native and got the following error:
While trying to resolve module `iconoir-react-native` from file `project_path/app/(tabs)/_layout.tsx`, the package `project_path/node_modules/iconoir-react-native/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`project_path/node_modules/iconoir-react-native/dist/esm/index.js`. Indeed, none of these files exist:
* project_path/node_modules/iconoir-react-native/dist/esm/index.js(.web.ts|.ts|.web.tsx|.tsx|.web.mjs|.mjs|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
* project_path/node_modules/iconoir-react-native/dist/esm/index.js/index(.web.ts|.ts|.web.tsx|.tsx|.web.mjs|.mjs|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
I've tried adding .mjs extension to metro.config, but that didn't help.
I've noticed the following line
in reality this is dist/esm/index.mjs not .js
When overwriting it to .mjs it works fine, and I no longer get the error message.
Is this a mistake or am I missing something ?
Thanks!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too