react-native reazy unable to resolve module - react-native

I am trying to test out the reazy react-native framework, I can't get the sample app up and running.
when I run the react-native run-ios command i am getting the following error:
unable to resolve module react/lib/reactComponentwithPureRenderMixing
node_modules/react-native-router-flux/node_modules/react-addons-pure-render-mixin/index.js
Module does not exist in the module map
I have removed my modules and reinstalled them. the module folder is there for react-native-router-flux
nothing in the JS console
any help is appreciated

Please install router flux using below and refresh
npm install --save react-native-router-flux
Hope! this helps.

Run the following command and it will be solved-
yarn add react-addons-pure-render-mixin
this is manual step to add this module.

Related

#walletconnect/client throw Error: While trying to resolve module crypto

I am using https://reactnative.dev/docs/environment-setup 0.64
I npm install #walletconnect/client
put below import in App.js
import WalletConnect from "#walletconnect/client";
after npx react-native run-ios and got below error:
error: Error: While trying to resolve module `crypto` from file `/Users/hahaha/workspace/mobile/reactnative/nonft/node_modules/#pedrouid/iso-crypto/dist/cjs/helpers/env/node.js`, the package `/Users/hahaha/workspace/mobile/reactnative/nonft/node_modules/crypto/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/hahaha/workspace/mobile/reactnative/nonft/node_modules/crypto/index.js`. Indeed, none of these files exist:
I tried to remove node_modules folder and npm install again but still get the same error.
I am sure that it is thrown by #walletconnect/client because when I removed
import WalletConnect from "#walletconnect/client";
then the error gone
crypto is a built in Node module, which isn't available in React Native, as iOS/Android apps don't run with a Node runtime - only web apps do.
There are a few ways to solve this problem, all of them fairly hacky.
One way is to replace the crypto module with a React Native native module that does the same thing. React-native-crypto is the package used by create-react-native-dapp (https://www.npmjs.com/package/create-react-native-dapp) to integrate with WalletConnect: https://www.npmjs.com/package/react-native-crypto
To get this integration working, note that you'll need to be able to link modules and run rn-nodeify, as it mentions in the instructions on that npm package:
npm i --save react-native-crypto
# install peer deps
npm i --save react-native-randombytes
react-native link react-native-randombytes
# install latest rn-nodeify
npm i --save-dev tradle/rn-nodeify
# install node core shims and recursively hack package.json files
# in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings
./node_modules/.bin/rn-nodeify --hack --install
If you're using Expo, note that you'll need to eject Expo before this can work.
Another hacky workaround is to run WalletConnect in a WebView using react-native-webview. There's an old but working example of this that you can just use to plug and play WalletConnect without requiring linking that you can get here: https://github.com/cawfree/react-native-walletconnect
Note that that repo is archived and effectively hardcoded to WalletConnect version 1.0.0, but it's a pretty simple codebase - you can just effectively copy and paste its code and update it to the latest version of WalletConnect to get it working with a later version if desired.
As a final note, there are multiple ways to get node modules running in React Native on top of rn-nodeify. If you'd like to explore other methods of getting node modules running, here's a quick rundown of other possibilities: https://gist.github.com/parshap/e3063d9bf6058041b34b26b7166fd6bd

Struggling to set up nativebase in a React Expo project

I have tried so many different ways to set nativebase up with expo and am still having an issue. At the moment I'm using the
Getting Started documentation found on the nativebase website.
I first create a new app with expo using
expo init myapp
Then I install nativebase using
npm install native-base --save
Then I finally install the font
expo install expo-font
I even copy the App.js found in the getting started documentation, and after I start the app and try to run it on an emulator I face the below error
Unable to resolve "#expo/vector-icons/Fontisto" from "node_modules\native-base\dist\src\basic\IconNB.js"
Failed building JavaScript bundle.
What am I missing? Coming from .NET world this whole process with dependencies is so painful...
*Edit 1
I'm sure someone will make mention of the fact that the error message mentions #expo/vector-icons and I have not installed that. When running before I install this package I get that error, and after I install the mentioned package I still face the exact same error.
Please try with this version of native base :
npm i --save-exact native-base#2.13.8
Expo should release a version with that version .
Hope it helps. feel free for doubts
We can run the below command with Expo
npm i --save-exact native-base#2.13.8
Still this version is not available, but its working, really don't know why?

Graphql error when building react-native app

I'm getting this error on node when I try and npm run android my react native app
Unable to resolve "./printError" from
"node_modules/graphql/error/index.js
The error only occurs when attempting to import any libraries that require Graphql. Graphql is installed, and I've uninstalled and reinstalled my node_modules several times attempting to fix this but nothing works. Any help would be appreciated.
printError was added with v0.12.0. Apollo requires at least v14.5.4. You can install the latest version with npm install graphql#latest.

How to fix "Can not find module ".../template.config" error in React Native

I'm trying to create a new application in React Native using react-native init MyApp But I got this error:
√ Downloading template
× Copying template
error Error: Cannot find module 'C:\Users\Emre\AppData\Local\Temp\rncli-init-template-hNGjwo\node_modules\react-native\template.config'
What I've tried:
npm install -g react-native-cli
then
react-native init MyApp
What do I need to do to solve this problem?
yarn global add #react-native-community/cli#2.0.0-rc.2 then react-native init MyApp worked for me
I am using nvm.
Fixed this issue by nvm use 12.4.0. Issue was using node v10.16.3:
If you already have npm installed, you can do it with npm. Simply type:
npm install -g #react-native-community/cli#2.0.0-rc.2
react-native init name_of_the_app
This one worked just fine for me!

Error encountered after I execute react-native install

C:\ProjectName> react-native install
Scanning folders for symlinks in C:\ProjectName\node_modules (794ms)
error: missing required argument `packageName'
I ran the command above and recieve the error shortly afterwards. I am not very sure what the problem is I am new to react-native and was just trying to ran an already developed project. I hope someone can help shed some light regarding this.
You are missing the package manager.
If you are using yarn:
yarn add react-native
or npm:
npm install react-native
You can read more here:
https://blog.risingstack.com/yarn-vs-npm-node-js-package-managers/
EDIT: Also, don't forget to install react-native-cli