Skip to content

"Module not found: Error: Can't resolve..." error when using custom babel configFile #795

Closed Answered by satya164
rickh3nry asked this question in Q&A
Discussion options

You must be logged in to vote

When the module is built there is a package.json generated with `{"type": "module"}

This seems to be a bug. This file shouldn't be generated if esm is not enabled. I made a fix here and published a new version. Please upgrade and let me know if it fixes your issue.

Also, it's recommended to extend the default config (react-native-builder-bob/babel-preset) when using a custom babel configuration (though not necessary in this case) https://callstack.github.io/react-native-builder-bob/build#configfile

While it wouldn't be necessary for your setup specifically since you don't have esm enabled, it's still recommended to use resolve.fullySpecified: false for projects that may use React Native…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rickh3nry
Comment options

Answer selected by rickh3nry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants