react-native run-ios won't work after changing projects name - javascript

I decided to change the name of my React Native project by first changing it in the main directory to name it "AppName" by getting rid of its previous name.
I also changed all the folders names inside my ios into AppName and got rid of its previous name.
Even inside the index.ios.js, I got rid of its previous name.
However, whenever I run react-native run-ios, I get the following error:
Installing build/Build/Products/Debug-iphonesimulator/AppName.app
An error was encountered processing the command
(domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier
build/Build/Products/Debug-iphonesimulator/AppName.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Why am I getting this error? I know it has something to do with changing the name of my project.

to rename react native project you should use react-native-rename
because manual rename will break your project

Related

Why is my react app showing a blank page?

I don't know where everything went wrong but at some point, my react app started showing only a blank screen. I've look into some tuto and afterward, I've realize that when I run the command npm run build, I get the following error :
Failed to compile.
The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script

React App production build blank has nothing but a blank page

I am quite new to react (and still learning), so I apologize if the problem is too basic.
I have created a shoe store App (inspired by this tutorial on React Router v6)
The problem I am facing is that the App works perfectly on development build.
But when I create a production build (yarn build) and serve it using npx serve -s build, I get an empty page
The console gives an error that shoeData (a javascript object on a separate shoeData.js file with named export.) is not defined. There was no such error on development build. In fact, just before the errors on the console in the production build, an array has been logged twice using the following code
console.log(Object.keys(shoeData).filter((productId) => shoeData[productId].featured));
The above code uses the shoeData object, therefore the object is available to the component at least initially.
I have also modified the package.json to add "homepage": "." since people have solved similar issues using this fix, but it doesn't work in this case.
The complete project is available on GitHub here
Any help in this regard would be highly appreciated
What I can see on url is that, ReferenceError: shoeData is not defined is being shown. Please look after it.
I'm also looking what's the reason just cloning the repo
This line looks weird,you should pass string to src rather than require a file.
I just clone the repo and make sure the problem is cause by require().
Steps to fix:
Move images/ into public/ folder
Replace all require('...').default with image url, such as /images/${shoeData[productId].gender}/${productId}/01.jpg.
Remove homepage field from package.json

Electron cannot find module because of wrong path

Im running a normal electron application, but when I run "npm start" it gives me the following error:
Error: Cannot find module 'D:\General\projects\electron\cli.js'
But the app folder is D:\General\projects\testProject and there it is the node_modules... and all the required folders in my test project.
I've also tried installing globally and locally, updated npm and electron... but no results.
As far as I can see, the error is that electron is not looking at the correct path but, how could I change the path where it looks for the cli?
I found the problem, the directory had an special character at the name (&), so nodejs couldn't read the path correctly. I changed the name and now it works correctly.

ionic:Runtime Error Cannot find module "../pages/home/home"

I want to make an app in ionic, so I add some custom page in ionic by command :
ionic g page user
But I start ionic server it show error
Runtime Error Cannot find module "../pages/home/home"
click for error image
If the app tells you that it misses a file, that's because there's somewhere where you imported this file and it doesn't exist (anymore? maybe you deleted it and forgot to delete an import)
You should make a project-wide text search using grep or your favorite ide to find where you are importing "../pages/home/home".
Your error doesn't come from your ionic g page user command as this command only generates a page named user.
It seems like you created a page called home and deleted it without deleting imports.
I encountered the same problem when I was github clone code.
But this is not the problem with the code itself, but because I used cnpm (npm of the Chinese version).
Uninstall npm, install npm. The problem is solved

react-native-db-models Uncaught error

I am wanting to use the react-native-db-models for local-db on my React Native iOS app.
I've npm installed react-native-db-models from here and have followed the instructions on the page of creating a db.js file that contains the example given on both Github page and NPM page. Then in the file that needs access to the DB, I've created vars for both DB and DBEvents, following the docs accordingly.
When running the project in Xcode it results in a Build Fail.
uncaught error Error: UnableToResolveError: Unable to resolve module
util from /Users/tmhn/Project/DoppioHealth/node_modules/react-native-db-models/node_modules/promise-es6/lib/utils.js:
Invalid directory /Users/node_modules/util
I have also npm installed the two dependencies listed on the npm page: es6-promises and eventemitter3, to no avail.
Note: DoppioHealth is the project name
Investigated the Github Issues and found this solved the issue

Categories