Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Does Not Proceed Past Sign-In Page #2

Closed
yannusinovich opened this issue Dec 16, 2021 · 9 comments
Closed

App Does Not Proceed Past Sign-In Page #2

yannusinovich opened this issue Dec 16, 2021 · 9 comments
Assignees

Comments

@yannusinovich
Copy link

@andreysaf I followed your tutorial exactly, with the only differences being (1) I enabled both the Firestore Database and the Realtime Database in Firebase (I believe these are new sections in the Build menu that did not exist when you wrote the tutorial) and (2) I added all the variables you listed to one .env file, since I couldn't create two files with the same name in the root of the directory. I am able to start the app with npm start, and then I am able to register an email and password (they show in Firebase under Authentication), but when I click "Sign in" nothing happens. Do you know what may be the issue? I primarily work in Python, so I may have missed something that needs to be done in Node.js to make the app function. Thank you for any help you can provide!

Terminal output after npm start:

Compiled with warnings.

./src/components/Search/Search.js
  Line 12:56:  'Image' is defined but never used  no-unused-vars

./src/components/Upload/Upload.js
  Line 1:17:  'useState' is defined but never used                                                                                  no-unused-vars
  Line 2:23:  'useDispatch' is defined but never used                                                                               no-unused-vars
  Line 3:10:  'Link' is defined but never used                                                                                      no-unused-vars
  Line 67:6:  React Hook useEffect has missing dependencies: 'index' and 'uid'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

./src/components/Navigate/Navigate.js
  Line 2:10:  'Router' is defined but never used  no-unused-vars

./src/App.js
  Line 32:6:  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array. Outer scope values like 'auth' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

./src/components/View/View.js
  Line 62:6:  React Hook useEffect has missing dependencies: 'docRef', 'pageNumber', and 'searchTerm'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
@andreysaf
Copy link
Contributor

Hello @yannusinovich, thanks for reaching out!

Could you share what is printed in the console of the browser when you are trying to log in?

@andreysaf andreysaf self-assigned this Dec 16, 2021
@yannusinovich
Copy link
Author

@andreysaf Yes, the console has the following:
Screen Shot 2021-12-16 at 12 42 06 PM

printWarnings @ webpackHotDevClient.js:138
index.cjs.js:129 Uncaught (in promise) FirebaseError: Missing or insufficient permissions.
at new n (index.cjs.js:129)
at index.cjs.js:10175
at index.cjs.js:10176
at n.onMessage (index.cjs.js:10209)
at index.cjs.js:10115
at index.cjs.js:10146
at index.cjs.js:5542
www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyCxaDwZvmuVHxUNxMoCwYf6BoQ8rKsDbO0:1 Failed to load resource: the server responded with a status of 400 ()
index.js:1 Error signing in with password and email t
console. @ index.js:1
www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyCxaDwZvmuVHxUNxMoCwYf6BoQ8rKsDbO0:1 Failed to load resource: the server responded with a status of 400 ()
index.js:1 Error signing in with password and email t
console. @ index.js:1
www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyCxaDwZvmuVHxUNxMoCwYf6BoQ8rKsDbO0:1 Failed to load resource: the server responded with a status of 400 ()
index.js:1 Error signing in with password and email t
console. @ index.js:1

@yannusinovich
Copy link
Author

yannusinovich commented Dec 17, 2021

@andreysaf I made some headway on this one:
I changed the Firestore Database rules (google-home/smart-home-nodejs#369):

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read;
      allow write: if false;
    }
  }
}

I changed the Storage rules (https://www.youtube.com/watch?v=cOA06v8qA0g):

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}

However, I still get this error, which I can't find a solution to online:
Uncaught (in promise) FirebaseStorageError {code_: 'storage/invalid-argument', message_: 'Firebase Storage: Invalid argument in 'child' at index 0: Expected string.', serverResponse_: null, name_: 'FirebaseError'}
Do you know by any chance what could solve this? Is it a matter of converting the type of a variable in one of the .js files to a string? Or is it another Firebase permissions issue?

This is what the error looks like:
Screen Shot 2021-12-16 at 10 53 08 PM
This is what the app looks like:
Screen Shot 2021-12-16 at 10 59 32 PM

I'm happy to update your README.md once I get things working, if you'd like.

@andreysaf
Copy link
Contributor

That would be great! Let me sping it up locally and see if I run into same thing.

@andreysaf
Copy link
Contributor

@yannusinovich Here are the rules that I have configured. Could you try and see if that is resolved?

Change Firestore Database rules to:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

Change Storage rules to:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}

@yannusinovich
Copy link
Author

yannusinovich commented Dec 21, 2021

@andreysaf Thank you very much for getting back to me. I changed both of the rules as you suggested, but unfortunately the app is having the same error.

Are npm install and npm start the only commands I need to run the app?

The "Upload new documents" screen doesn't really look like how I would expect either - I have to exit out of it manually with the back button in my Chrome browser and it has another error that PDFTron says is not important - but I don't know if these are related to the issue with the "Search existing documents" page in the previous comments.

Screen Shot 2021-12-21 at 3 06 02 AM

@andreysaf
Copy link
Contributor

Hey @yannusinovich, let's do a quick call when I am back to help set the app. The pnacl error is just a warning. https://calendly.com/andrey_pdftron/30min

@andreysaf
Copy link
Contributor

After a call, seems like the issue is now resolved.

@AaronGabriel147
Copy link

AaronGabriel147 commented Sep 9, 2022

After a call, seems like the issue is now resolved.

What was the solution? I have the same error when I delete an image storage/doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants