-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Which package are you using?
@react-native-vector-icons/*
What platform(s) does this occur on?
iOS
Minimal reproducible example
https://github.com/rafaels-dev/rnvi-esm-error
What happened?
I have a project running on react-native@0.80.2. When I try to update the ios Info.plist to add the Fonts to the iOS project, I'm noticing the following error:
rafael@MacBook-Air-de-Rafael TestRnviError % npx rnvi-update-plist ./package.json ./ios/TestRnviError/Info.plist
/Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js:315
undefined
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/node_modules/find-up/index.js from /Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js not supported.
Instead change the require of index.js in /Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at Object.<anonymous> (/Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js:9:15) {
code: 'ERR_REQUIRE_ESM'
}
** Steps to reproduce error:
- Initialize a new react-native 0.80.2 project using the command
npx @react-native-community/cli@latest init TestRnviError --version 0.80.2
- Enter to the project folder and add the fontawesome iconset using the command
npm i @react-native-vector-icons/fontawesome
- Try to update the Info.plist of the ios project using the command
npx rnvi-update-plist ./package.json ./ios/TestRnviError/Info.plist
Relevant log output
rafael@MacBook-Air-de-Rafael TestRnviError % npx rnvi-update-plist ./package.json ./ios/TestRnviError/Info.plist
/Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js:315
undefined
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/node_modules/find-up/index.js from /Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js not supported.
Instead change the require of index.js in /Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at Object.<anonymous> (/Users/rafael/workspace/react-native-migration/TestRnviError/node_modules/@react-native-vector-icons/common/lib/commonjs/scripts/common.js:9:15) {
code: 'ERR_REQUIRE_ESM'
}
Your computer environment
Model Name: MacBook Air
Model Identifier: MacBookAir10,1
Model Number: MGN63LL/A
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 8 GB
System Firmware Version: 11881.140.96
OS Loader Version: 11881.140.96
Operational system: macOS 15.6 (Build version 24G84)
NodeJS version: 22.11.0
NPM version: 10.9.0
nick-carma