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

Cannot run the project #8

Open
koravski opened this issue Mar 7, 2021 · 2 comments
Open

Cannot run the project #8

koravski opened this issue Mar 7, 2021 · 2 comments

Comments

@koravski
Copy link

koravski commented Mar 7, 2021

Hi, I have trouble running the project. I've managed to deploy it but I get this error:
Access to fetch at 'https://us-central1-scrabble-16935.cloudfunctions.net/validateUser' from origin 'https://scrabble-16935.web.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
VM1464:1 POST https://us-central1-scrabble-16935.cloudfunctions.net/validateUser net::ERR_FAILED
index.cjs.js:58 Uncaught (in promise) Error: internal at new e (index.cjs.js:58)
Any ideas on how to fix it?
Thanks.

@cloppingemu
Copy link
Owner

cloppingemu commented Mar 7, 2021

Hi @koravski haven't visited my JS projects for a while, but I recently, the validate user function for another one of my project stopped working when I updated my project. This could be down to some update in Firebase Functions/Auth API. I will have another gander at it sometime this.

Just to make sure I have covered my basis here, functions need to import service keys to be able to access the database and perform admin duties. Did you add service keys to your project?

@koravski
Copy link
Author

koravski commented Mar 7, 2021

Yes, I did. I have added also:
project_owner_email in the service keys file.
I guess is something small I haven't done correctly, but not sure what is it.
When I try to create a game I get this as well:
Internal read error. TypeError: Cannot read property 'instances' of undefined, [object Object]
Any ideas what this might be?
Thanks.

PS I think it could be from my firebaseInit.js file. Could you share yours without the keys?

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

2 participants