fengari-lua / fengari

🌙 φεγγάρι - The Lua VM written in JS ES6 for Node and the browser
MIT License
1.8k stars 64 forks source link

React Native Support #144

Closed logan-granberry closed 5 years ago

logan-granberry commented 5 years ago

I've run into a few issues getting this to work within our React Native app due to missing modules. Has anyone gotten this to work in React Native?

daurnimator commented 5 years ago

There shouldn't be issues. What error(s) did you get?

logan-granberry commented 5 years ago

Can't find the modules fs, and child_process. I replaced fs with react-native-fs, but i can't find a substitute for child_process. There may be others, i'm fixing references in the order they appear.

daurnimator commented 5 years ago

fs and child_process are only used by fengari when it is targetting node. I assume from this that ReactNative is more like a browser? Try compiling/using fengari with typeof process defined to undefined as we do in fengari-web: https://github.com/fengari-lua/fengari-web/blob/a9fb130f6851206e8a57be902af061e980be5610/webpack.config.js#L59

daurnimator commented 5 years ago

Closing due to lack of reply.