Skip to content

Cannot build in scaffolded project (ERR_REQUIRE_ESM) #827

@tgrassl

Description

@tgrassl

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

  • create-react-native-library
  • react-native-builder-bob

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions