Description
When scaffolding a fresh project using the "JavaScript library" type and running yarn run prepare builder-bob fails with the following error:
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/user/develop/esm-error/node_modules/arktype/out/index.js from /Users/user/develop/esm-error/node_modules/react-native-builder-bob/lib/build.js not supported.
Instead change the require of index.js in /Users/user/develop/esm-error/node_modules/react-native-builder-bob/lib/build.js to a dynamic import() which is available in all CommonJS modules.
Packages
Selected options
npx create-react-native-library@latest esm-error
Type: JavaScript library
Link to repro
https://github.com/tgrassl/esm-error
Environment
OS: macOS 15.3.2
Node: 22.8.0
Description
When scaffolding a fresh project using the "JavaScript library" type and running
yarn run preparebuilder-bob fails with the following error:Packages
Selected options
npx create-react-native-library@latest esm-errorType: JavaScript library
Link to repro
https://github.com/tgrassl/esm-error
Environment
OS: macOS 15.3.2
Node: 22.8.0