No description provided.
react-native doesn't handle the /index.js in browser fields
@dantman could you explain me a bit more what is this and why it is needed?
@elhigu React Native has its own packager based on browserify responsible for bundling the JS code for native iOS/Android apps. It handles the "browser" field in package.json as well as a "react-native" field with React Native specific overrides to "browser".
React Native isn't a browser or server environment, but it's similar to a browser environment. No node.js runtime, fs, etc... like the browser except no dom and other browser features but some react-native-* packages providing access to native iOS/Android features like native hardware, App storage, Android/iOS sqlite databases, etc...
So when you require knex in a react-native project (say, so you can either use the query builder/toSQL or write your own knex driver for an Android/iOS Sqlite database) it fails in the same way that it fails in the browser. But the browser handling doesn't behave 100% the same as browserify. React Native matches ../migrate in lib/util/make-knex.js against "./lib/migrate" instead of "./lib/migrate/index.js" like the handler browserify uses.
Sounds good, thanks 👍