Open MartijnGevaert opened 2 years ago
+1
We're also using react-native-vector-icons with react-native-web, and facing same error for production build only.
any any update on this?? still facing this issue while running react-native-paper using react-native-web
My team used Patch Package to implement MartijnGevaert's solution above in our build, and this has been working for us.
Please try using the @babel/plugin-transform-modules-commonjs
plugin
Environment
I have a react-native app which I also compile for web. This app uses create-react-app which provides the
yarn build
command, used to create a production build. The app is quite large and contains many dependencies which compile without issue, this makes me suspect that my setup is valid.Description
When running yarn build, following error is thrown:
Possible solutions
solution 1
This can be solved by going into
object-utils.js
and adding export to theconst pick
andconst omit
.solution 2
Replacing
module.exports =
byexport
insideobject-utils.js
Motivation to implement one of these change
I noticed the files
create-icon-set-from-fontawesome5.js
andcreate-icon-source-cache.js
already utilize anexport {...}
so I don't think the changes I suggested will break any functionality.Reproducible Demo
Can't really create a snack app for this since it only occurs when running the build command
Information needed
I'm far form an expert when it comes to imports and module types. Feedback on which of the 2 provided solutions is best will allow me to create a PR for this.