I'm updating @react-native-vector-icons/common to be in line with the latest create-react-native-libarary.
I modified the codegenConfig in my package.json and the package was no longer being discovered when I run "react-native codegen"
The code that does this ignores errors in a libraries project.json. The error was
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /home/johnf/work/inodes/react-native-vector-icons/node_modules/@react-native-vector-icons/common/package.json
at exportsNotFound (node:internal/modules/esm/resolve:304:10)
at packageExportsResolve (node:internal/modules/esm/resolve:651:9)
at resolveExports (node:internal/modules/cjs/loader:634:36)
at Module._findPath (node:internal/modules/cjs/loader:724:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1211:27)
at Function.resolve (node:internal/modules/helpers:190:19)
at /home/johnf/work/inodes/react-native-vector-icons/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:241:38
at Array.flatMap (<anonymous>)
at findExternalLibraries (/home/johnf/work/inodes/react-native-vector-icons/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:239:36)
at findCodegenEnabledLibraries (/home/johnf/work/inodes/react-native-vector-icons/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:538:10) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Packages
[X] create-react-native-library
[ ] react-native-builder-bob
Selected options
I fixed this by adding the following to package.json
android-34 | Google Play Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10811636
Languages:
Java:
version: 11.0.24
path: /usr/bin/javac
Ruby:
version: 3.2.3
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: false
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: false
Hey @johnf thank you so much for creating an issue about this. This helped us find a bigger problem in CRNL and bob. You can find more details in #658.
Description
I'm updating @react-native-vector-icons/common to be in line with the latest create-react-native-libarary. I modified the codegenConfig in my package.json and the package was no longer being discovered when I run "react-native codegen"
The code that does this ignores errors in a libraries project.json. The error was
Packages
Selected options
I fixed this by adding the following to package.json
Link to repro
https://github.com/oblador/react-native-vector-icons/tree/monorepo in about 20 mins haven't commited yet you'll need to undo the fix in package.json
Environment
System: OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat) CPU: (16) x64 AMD Ryzen 7 7840U w/ Radeon 780M Graphics Memory: 15.90 GB / 30.66 GB Shell: version: 5.2.21 path: /bin/bash Binaries: Node: version: 20.17.0 path: ~/.nvm/versions/node/v20.17.0/bin/node Yarn: version: 4.2.2 path: ~/.nvm/versions/node/v20.17.0/bin/yarn npm: version: 10.8.2 path: ~/.nvm/versions/node/v20.17.0/bin/npm Watchman: Not Found SDKs: Android SDK: API Levels: