Unable to resolve module `schedule/tracking` - ios

So I made a react-native project that fully works on android now, but when I try to run it on ios I keep getting more problems.
picture
I know this question is already all over stackoverflow and the react-native github page, but all those answers don't seem to work for me and I doubt anyone checks those comments anymore.
I had a similar problem on another project but IIRC that was solved by updating my RN version.
Does anyone know what I did wrong here?
I already tried:
updating RN
downgrading RN
installing #babel/runtime: 7.0.0
installing schedule: 0.4.0
removing all the '^'-characters of the package version
remove node_modules and package-lock.json and reinstalling
...
package.json
"dependencies": {
"#babel/runtime": "7.0.0",
"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.2",
"react-native-fetch-blob": "0.10.8",
"react-native-orientation": "3.1.3",
"react-navigation": "3.0.9"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.47.0",
"react-test-renderer": "16.6.0-alpha.8af6728",
"schedule": "0.4.0"
},

Few things that may guide you in the right direction.
Are you sure you want the dependency on the devDependencies section, instead of dependencies? Development dependencies are for the tooling used for your project, not the project itself. Importing code from devDependencies directly in your application code is a code smell. Also, which may be a case for you, some CI servers may not install devDependencies by default.
There is no tracking file in the 0.4 version of the package. However, there is a tracing.js file. Are you sure you're importing the right file? You can browse all files bundled in the package here.
As the documentation states: "This is a package for cooperative scheduling in a browser environment.". Are you're sure you can use it in React Native?
Last two points don't explain why it works on Android and not on iOS thou.
If you don't need schedule package directly, and you install it only because of the error, then you should remove it from package.json as it shouldn't be there in the first place (remember to remove node_modules / clean cache afterward).
This is an internal React package, and you should not use it directly unless you knew what you are doing. In this case, the root cause of the initial error is probably something different.

Related

. Why I am getting an error message? Building a React App

I wanted to start practicing with React to make a simple app. Went ahead and downloaded homebrew and node onto my computer. As I build my app with yarn install I get to the end where it tells you happy hacking. But when I run yarn start it gives me an error message.
-There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"eslint": "^6.6.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:
/Users/zacharyschneider/node_modules/eslint (version: 5.16.0)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if /Users/zacharyschneider/node_modules/eslint is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls eslint in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed eslint.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
zacharyschneider#Zacharys-MBP %
A way to solve this issue or help me understand what is going on that would be great or point me in the right direction to find resources.
Thanks for your Help
It seems like you have installed es-lint 5.16.0 manually, and it conflicts with the needed version (6.6.0).
Have you tried the steps suggested in the error message?
Do you explicitly tell the es-lint version in your package.json? Could you share your package.json if you continue to experience the issue?

React native fresh install ReferenceError: Unknown plugin "transform-runtime" specified

update
This worked for me per #digit comment
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.45.1"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.0.0",
...
},
I followed the instructions for building projects in native code for macos > ios. I ran react-native run-ios and I got the error in the title... Any thoughts? My thoughts are at the end if you want to read it.
Unknown plugin "transform-runtime" specified in "<myprojectdir>/node_modules/regenerator-transform/package.json" at 0, attempted to resolve relative to "<myprojectdir>/node_modules/regenerator-transform" (While processing preset: "<myprojectdir>/node_modules/babel-preset-react-native/index.js")
package.json
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.46.0"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.1.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
my npm & node versions
➜ nativeapp npm -v
4.6.1
➜ nativeapp node -v
v8.1.3
Thank you for looking. Below is my unrelated ranting about my react native but I do genuinely seek some guidance if you have any.
I watched the lectures of coders who works on react-native and I read as much as I can prior to my project and from what I can tell they are all geniuses. I am not being sarcastic I sincerely think that. Yet I fail to understand why my experience with react native is so bad. I mean ... fresh install ... should work? I do not know how many expo projects I have created and moved my stuff around before this because every freakin time I installed a package from npm, everything broke.
I've been a full time coder for 8 years and I've worked projects using things from bash to perl to python to php to golang to mysql to mongo to jquery to angular to vue to vanillajs to ionic to java to C to R yet I do not think I have ever been this frustrated with any new stack I have ever worked on.
What am I missing? What is it that I am doing wrong? Please somebody tell me because I am about to lose my mind and throw my laptop out the window. I spend my time debugging errors instead of making progress in my project. I get up in the morning two hours before work to work on this project and I work on it at home after work... It is 8PM and I've been trying to run the app for two hours now.
I am beginning to think I am the only one with these problems thus I am the cause. I see all these companies using react native and it does not make sense for any company to invest in something that is going to make its developers have the same experience as me. Just spending time on getting it to open.
Sorry about my ranting and please note that I care more about fixing the issue.
I am just passionate about what I do and I do not like spending my hours and not making progress for reasons that I do not expect to have. Thx for looking
According to this link https://github.com/facebook/react-native/issues/14843,
this is a bugs related to the babel-preset-react-native for react native v0.46. For temporary solution
1) Remove .babelrc by doing rm -rf .babelrc inside root folder
2) Revert babel-preset-react-native to the version 2.0.0

Unrecognised font family ‘Ionicons’ error - Native Base

I am trying to use native base icons in my app but every time i am getting Unrecognized font family ‘Ionicons’ error. I searched it on google and tried everything. like
rm -rf node_modules && npm install
react-native link react-native-vector-icons
react-native start --reset-cache
can anybody tell me some basic setups like where should I create my resource folder and all for this fix?
Thanks
I think you have to create folder call "Resources" in your Xcode project and place Ionicons.ttf file inside that folder.
Try setup iOS Manually here (https://github.com/oblador/react-native-vector-icons)
Browse to node_modules/react-native-vector-icons and drag the folder
Fonts (or just the ones you want) to your project in Xcode. Make sure
your app is checked under "Add to targets" and that "Create groups"
is checked if you add the whole folder.
Edit Info.plist and add a property called Fonts provided by
application.
for anyone facing similar issue while using the following combination
"native-base": "^2.8.1",
"react": "16.6.1",
"react-native": "0.57.7",
"react-native-gesture-handler": "^1.0.10",
"react-native-vector-icons": "^6.1.0",
"react-navigation": "^3.0.8",
first clean the node_modules folder, then reinstall and also link
rm -rf node_modules
npm i
react-native link
then from xcode clean and then build for the ios project and run it in the simulator from xcode itself.
I faced same issue.
Following steps helped me out:
Install react-native-vector-icons npm
Install pod
And you are good to go.

React-native error requiring unknown module 'react'

When I run my react-native app with Xcode, and after the app starts to load, I see this error:
"Requiring unknown module "react". If you are sure the module is there, try restarting the packager."
My package.json contents are:
{
"name": "the_golf_mentor",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react-native": "^0.21.0",
"react-native-button": "^1.4.2",
"react-native-cookies": "^0.0.5",
"react-native-db-models": "^0.1.3",
"react-native-navbar": "^1.2.1",
"react-native-side-menu": "^0.18.0",
"tcomb-form-native": "^0.3.3"
}
}
I have tried restarting the package manager, and I have also removed the node_module folder and done a fresh npm install. How do I fix this problem?
I had this after enabling hot reloading, and then downgrading my react version to support a library I was using.
Simulator > Reset Content and Settings
Got it running again.
In React Native React lives in react-native module instead of react (for React JS). In that case import React and other React Native modules via:
import React, {
Component,
View,
Text,
// other React Native modules
} from 'react-native';
I encountered the same error. I closed down IDE and restarted, it worked for me. If nothing works out, try npm install
You should require React from react-native in a react-native project, and not from react.
var React = require('react-native');
It turned out that the error message was an interim one I was receiving in the debugger. When I pressed continue a couple of times in the debugger, I received a message in the simulator window which indicated I had not registering the app properly, i.e. my AppRegistry.registerComponent call was invalid.
I suspect this was an unusual cause of the unknown module 'react' error message. In many cases, neciu's answer is probably more useful, so I have also upvoted it as well.
I had similar issue: "Error: Requiring Unknown module 3" after installing '#react-navigation/native', so I did the following to fix it:
Close everything (Metro, Debugger and Simulator)
npm install
npx pod-install ios (On Mac)
npm run ios
and that's it!

how to force bower to install a certain version of dependency

Assume a bower.json file in which dependencies are like
"dependencies": {
"angular": "~1.5.x",
"angular-routing": "*",
"ngDialog": "*",
"requirejs": "*"
}
because angular-routing requires another version of angular (say 1.2.x), bower prompts me to choose a version.
How could I force bower to install angular ~1.5.x automatically?
I figured out the answer. I'm sharing for others:
If I add the dependency with my favorite version to resolutions in bower.json, Bower will automatically install it. Here is my updated bower.json:
"dependencies": {
"angular": "~1.5.x",
"angular-routing": "*",
"ngDialog": "*",
"requirejs": "*"
},
"resolutions": {
"angular": "~1.5.x"
}
More information here.
Update:
As Mattliu mentioned in comments, it's possible to answer with ! when any library asks for another version of an already installed dependency. this way you'll keep existing version and also npm creates resolution config automatically.
If you would like to install JQuery 2.1.4 strictly and add it to your bower.json dependencies you would go like this
bower install jQuery#2.1.4 --save
You need to specify the version in bower.json.
Note that using a tilde will automatically resolve to any newer minor version
So, specifying ~1.5.x would pull 1.5.1 if it existed
To specify an exact version, remove the tilde e.g. specify "1.5.1"

Resources