Follow-up to
npx react-native@0.66.5 init RN0665 --version 0.66.5
yarn add ses
// index.jsimport'ses';// addedimport{AppRegistry}from'react-native';importAppfrom'./App';import{nameasappName}from'./app.json';lockdown({consoleTaming: 'unsafe'});// addedAppRegistry.registerComponent(appName,()=>App);// metro.config.jsconst{getDefaultConfig}=require('metro-config');module.exports=(async()=>{const{resolver: {sourceExts},}=awaitgetDefaultConfig();return{transformer: {getTransformOptions: async()=>({transform: {experimentalImportSupport: false,inlineRequires: true,},}),},resolver: {sourceExts: [...sourceExts,'cjs'],},};})();// babel.config.jsmodule.exports={ignore: [/ses\.cjs/],presets: ['module:metro-react-native-babel-preset'],};yarn start --reset-cache
yarn start ios
Result:
ERROR TypeError: undefined is not a function (near '...globalThis.process.on...')

(this|global|globalThis|window).process in our RN realm contains only {"env": {"NODE_ENV": "development"}}
So our Node API methods (on/exit/abort/etc) are missing https://nodejs.org/api/process.html#process (being an instance of EventEmitter)
Which we now need to be added to our vanilla RN PoC
First seen in
- MMM: RN 0.66.5 + SES 0.18.1
Follow-up to
npx react-native@0.66.5 init RN0665 --version 0.66.5yarn add sesyarn start --reset-cacheyarn start iosResult:
ERROR TypeError: undefined is not a function (near '...globalThis.process.on...')(this|global|globalThis|window).processin our RN realm contains only{"env": {"NODE_ENV": "development"}}global,selfas aliases forglobalThisLavaMoat#459So our Node API methods (on/exit/abort/etc) are missing https://nodejs.org/api/process.html#process (being an instance of
EventEmitter)Which we now need to be added to our vanilla RN PoC
First seen in