React-native: new projects issue - reactjs

In the very beginning, I created the AwesomeProject. Later when I use command
react-native init MyProject, it only created a package.json there. Before that, it could create other files, but very slow.
I searched some ways to fix it, now it only create one file.

It's a known issue that has been fixed (be sure to update react-native-cli): the command seems to hang forever nothing seems to be downloaded.
Try using react-native init MyProject --verbose to see what's happening and/or keep trying. The issue is not coming from your config.

Related

Next Build hangs forever

I'm building an app with NextJs and Typescript. I'm trying to run next build (yarn build) on my local machine to check for typescript warnings and build errors before deploying.
Next build hangs at 'Creating an optimized production build' and hangs forever. Don't even know where to start to address this issue. Can anyone help with this?
Could be a cache issue.
I'd start by removing /.next folder, if it didn't work then both /.next and /node_modules. Whenever you have issues with Next you don't know how to approach or it's just acting weird - removing /.next will solve most of the problems.
Have found the solution to the issue. Apparently the build freeze was caused by empty files located all over my project directory. Removed all of them and next build runs
I had the same issue too.
I solved it by upgrading node version from v16.13.0 to v16.14.0.
Make sure you stoped all servers that running in the background
Use npx kill-port 3000
Tried all the excellent suggestions here, but for me the problem was with optimizing one of the external packages. Since performance wasn't a big issue for me, skipping minifying solved it.
You need this in your next.config.js:
const nextConfig = {
swcMinify: false, // 'minify' in Next versions < 12.0
}
And to make sure this works, I reiterated all the above comments to make sure I wasn't hanging on one of the billion previous attempts :)
So the issue with it was that I had an empty file somewhere in the app. Apparently the empty file was what was hanging the build
You can't have both dev and build at the same time.
I solved it very quickly when I realized that there were several
nodejs processes open when there should only be 1, and killing all the
nodejs processes that were running in the background solved it for me.
It can also happen that a build started to fail and got stuck in the background so you should kill all the nodejs you see running in the task manager. I am using Nextjs 13
I solved it downgrading npm version to v8.5.5. I was testing using v8.12.2 and it always keep in "Checking validity of types"

NPM or Git caching files, can't build my project

I merged my branch with master, git merge master, and had a few conflicts. When I did this, my app was running and threw parser errors about the <<<<<<<... lines as expected.
I resolved the merges and now I'm getting the same error, but there is nothing in my code!
I can search the project for <<<< and find nothing. I've restarted my app npm run start, even switched branches, and it's stuck there. Made a new folder and recloned the project and that cleared it out. Any idea why/how this happened? How do I make sure this doesn't happen again.
It seems that a cache problem exists between webpack cache and resolving git conflicts.
the solution is:
stop your app
remove node_modules/.cache
start your app
It's possible that when you were trying to resolve the merge conflicts, pieces of your code were not marked as resolved.
A personal tip:
Using a GUI interface when resolving merge conflicts will help tremendously.
Applications like Github Desktop or using Github's own merge conflcit resolve will help better see your changes.

react-native link - Maximum call stack size exceeded

Following the Documentation of rnfirebase.io
Having this error when try to link the installed package.
react-native link react-native-firebase
Scanning folders for symlinks in /PROJ-DIR/node_modules (45ms)
rnpm-install ERR! Something went wrong while linking. Error: Maximum call stack size exceeded
There was already an issue raised against this here
but solutions are based on a problem with Xcode.
I'm not working for ios yet.
A solution regarding android is not working too.
Can anyone help me with this?
Try removing your android and ios folders and use following commands:
1.react-native eject to recreate android and ios folders.
2.react-native upgrade Be careful while running this command because it will replace your configuration files.
3.Finally react-native link
Many a times i too get this error and I follow these steps to overcome.
Take a look at this link
Make sure is there any unwanted changes are done in ios's project file. if yes then revert back as it is.
I faced this error after merging two branch and i have accepted both changes and got error and fixed it by proper merging

Imported linked libraries resets back when rebuilt - how to avoid for specific libraries?

I'm trying to make modifications to some of the imported libraries that I added using yarn. When I make a change to those libraries under node_modules, and then run react-native run-android, modifications are updated then. But when I run react-native run-android the next time, it gets reset back to the original.
I wanna make changes to it and save it with my custom modifications. How do I avoid it getting reset back to the original library? This question might sound really basic and stupid, but I have no idea how to and I can't find any solution to this when I tried to search a solution for this.
node_modules must not be changed manually as it is assumed to be read-only dependency.
If you still want to change one of node_modules , you have three ways :
Create a pull-request which contains your changes to the repository of this module and follow up with the owner of repository until merge the pull-request and publish your changes in npmjs.com.
Definitely, this solution can take much time which breaks your productivity . If so , the best solution is :
Fork the repository of the module , make changes and if the license allows you , publish your repo under https://npmjs.com using
cd /path/to/your-repo-after-changes;
npm publish;
Then go back to your project and run :
yarn add your-repo-after-changes ;
According to license, you may copy/paste the module source code that you want to change to your project under a folder (external-modules for example) , make your changes and export from external-modules .

Build project to run it in eclipse

My code runs a previous version of itself, so even though i completely remove all the code, it still runs the old one. I've read a few other posts regarding this problem, and tried it out. My temporary solution is to build the project before running it, but that is kinda stupid. the .exe file is in the Release folder, and my Debug folder dissapeared after the Clean.
How do I stop needing to build the project before everytime I need to run it?
I found out there's a button called auto build in the Launch Configuration properties window. So it build everytime I run it.

Resources