Missing aws-exports file while loading existing AWS Amplify project onto local computer - aws-amplify

When running react app which has AWS Amplify, Module not found: Error: Can't resolve './aws-exports' in .. error is coming.
Hi! Here is an overview of the problem and what I have tried so far:
My partner created a new AWS Amplify project which I am now trying to load onto my computer. I logged in with the same root credentials but created a new local user onto my computer.
I then ran amplify init, amplify pull, and amplify push.
However, when I run my react app, I get the error that they can't resolve ./aws-exports in my directory.
I think a possible issue is that I put the source dir for amplify init as my directory, not as the src folder inside - but I don't know how to change that (I am not sure how to use amplify update for this).
Are there any other solutions people have tried too?
Appreciate the help, thank you!

Related

firebase deploy not working even though firebase init command has worked

I'm a newbie in programming and still learning some stuff (i use windows btw).
i try to make an app, connect it to firebase. after setting up everything its time to setting the CLI
good news : i successfully setting up everything from node to nvm until successfully launch the login in CLI.
bad news : right after successfully login the CLI, i'm trying to type in the cmd
firebase deploy --only function
and this error appear
Error: not in a Firebase app directory (could not locate firebase.json)
i already search the web for the solution, but i found nothing.
can someone tell me did i miss something ?

Firebase Hosting and Github Action error "auth/invalid-api-key"

I'm using React for my project along with Firebase. Using Github Actions my code is successfully deployed to firebase.
But when I visit the hosted URL It gives me an error in the console saying
"Your API key is invalid, please check you have copied it correctly."
However when I deploy from the local system directly using firebase deploy It works fine.
I have taken the required care of my environment variables. But nothing seems to work.
It seems there is some problem while GitHub actions deploy the changes to firebase. Though all the build pass it gives me an error as stated above. Please Help.
This happen because GitHub actions don't have access to your .env on your local machine, you need to configure that on "GitHub Secrets" and put on your yml file.

NativeScript + Firebase, new firebase project is not being picked up

I am working with Master Detail with Firebase Angular template, and I can successfully build the app locally.
But then when I try to reconfigure the app for my own firebase project, nothing seems to change. It continues to query the default app's firebase.
I have followed the instructions for changing firebase app to my own to the letter but I cannot figure out why it still keeps pointing to the old app.
These are the steps I take to change the firebase app:
I create an App in Firebase, using the app id from package.json.
I download google-services.json and copy it to App_Resources/Android/google-services.json
Additionally, I delete google-services.json from platforms/android/app, just in case.
I uninstall the previously installed App from the emulator. I event deleted and created a new emulator to make sure there are no remnants of the previously built app.
I search all the files in the project for any reference for https://car-rental-b26b7.firebaseio.com which is the default firebase app that comes with the template, and I don't find anything at all.
I also edited firebase.common.ts with the following upon successful initialisation:
.then((instance) => console.log("firebase.init done", instance),
Just to see which project its initialising.
7. Finally, I build: tns run android
And sure enough, the console log shows https://car-rental-b26b7.firebaseio.com as the project being initialised.
I know for definite it is copying the new project's google-services.json over to platforms/android/app, because when I deleted the file it refused to build, as expected. Placing the file back, it builds successfully.
But I have no idea why it continues to reference the original firebase project.
Has anyone come across something similar?

Why does firebase warn "* You are currently outside your home directory" during an init?

I am trying to deploy my first firebase app. I am getting the message "* You are currently outside your home directory" I googled it and found this reply
"commented on Dec 6, 2016
Just to make sure you're aware. If someone is experiencing the same problem with with the command firebase init
Make the files .firebaserc and firebase.json manually and the deploy should work normally."
I do not know where to create them or what the should contain.
I have also gone to https://www.npmjs.com/package/firebase-tools to try to fix this problem.
If any one can help with this problem I would appreciate it.
If anyone else worried about this just keep going. I continued with the deployment and it deployed OK.
download firebase CLI binary (in case you didn't download it yet. this is an .exe file if you use windows).
copy the downloaded file into your project's root folder (Folder which contains all the files and folders of your projects).
run the firebase-tools-instant-win_2.exe (firebase CLI binary).
a command window will open.
execute all your command in there.
Initialize a Firebase project
Many common tasks performed using the CLI, such as deploying to a Firebase project, require a project directory. You establish a project directory using the firebase init command. A project directory is usually the same directory as your source control root, and after running firebase init, the directory contains a firebase.json configuration file.
To initialize a new Firebase project, run the following command from within your app's directory:
I used firebase init project in my project's directory to get it to work

How to update a file that I deployed to Firebase Hosting?

On deploying my app to Firebase, I am getting this message:
You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!
I learnt from a previous post that I need to replace the default index.html with my custom index.html. How do I do that using the Firebase Console?
You cannot change hosted files in the Firebase Console.
Instead, you should change the index.html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.
For small changes it is probably faster to run firebase serve. This spins up a local web server, so that you can test the changes. Once you're satisfied they work, publish them to Firebase Hosting with firebase deploy again.
Update: this is now possible through some custom scripting. See my answer here for details: Upload single file to firebase hosting via CLI or other without deleting existing ones?
Simply make the changes you want to and then type
npm run build
After this spin the server again using
firebase deploy
The changes you want will be updated.
You can also see the updated changes with the command
firebase serve
and then run firebase deploy when you're satisfied.
First of all Update all the coding and assets files in your local system then,
1) Go to the directory in the terminal by typing $ cd {add your directory}
2) Login on your terminal console by typing $ firebase login in the terminal
3) after login write $ firebase deploy
then, go to Hosting Section in your Firebase Console and delete the previously deployed files by deleting the previously added section in {Poject_Name} release history,
like this
enter image description here
Its a simple solution. This message is caused by the index.html file in your public folder being replaced with the index.html file provided by firebase.
All you have to do is navigate to the directory of your web app folder on your terminal and type in
$ rm .firebaserc
then
$ firebase init
after you've completed the firebase initialization, replace the new index.html file with the one inside the public folder and then type
$ firebase deploy

Resources