Skip to content

Why can not transpile all the node modules by default ? #732

Answered by jbroma
ra1nj asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ra1nj,

that's a very good question! The template we provide with Re.Pack, limits the number of transformed modules by default to not be too hard on the performance side.

The error you've encountered is due to how modules are processed by both bundlers - some rules from @react-native/babel-preset don't play nicely in webpack. You usually need to track down these modules and adjust them on a case-by-case basis. In the case you have above, it's most likely that the module was recognized as an ESM, but was then compiled down to CJS (because of the RN preset) and webpack didn't not take that into account and forgot to expose exports property for it. That's the gist of it

In the next major…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by ra1nj
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