cloppingemu / Scromble

Scromble: online multi-player scrabble powered by VueJS and firebase
1 stars 0 forks source link

Cannot run the project #8

Open koravski opened 3 years ago

koravski commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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?