C
C#7mo ago
Karlo

ASP.NET CORE + firebase deploying to Heroku issues

I'm creating a ASP.NET core API for my multiplayer game and at the end of every game there is a pdf report that holds all information about the game that was played. Now the issue comes when downloading the PDF, it all works locally and its all normal, so basically I hold the pdf in base64 encoding and save it to a firebase collection and then retrieve it on frontend to download. The issue comes when I deploy to Heroku when it gives me an error when downloading the pdf, this is my google console when I try to downlaod it: index.html:1 Access to fetch at 'https://kontranto-b16c0ebd90f9.herokuapp.com/api/pdf' from origin 'https://kontranto.eu' 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. VM107:208

POST https://kontranto-b16c0ebd90f9.herokuapp.com/api/pdf net::ERR_FAILED 500 (Internal Server Error) sendRequest @ VM107:208 (anonymous) @ VM107:184 Promise.then (async) getReport @ VM107:175 onclick @ index.html:1 downloadpdf.js:29 Downloading PDF with GAME_ID: jqs2cf downloadpdf.js:52 PDF document not found! Its saying its a cors error but its not, my cors is all right, but my heroku logs say different. I pasted my heroku logs. It saying Please check the value of the Environment Variable GOOGLE_APPLICATION_CREDENTIALS. 2024-03-08T18:24:35.519622+00:00 app[web.1]: ---> System.IO.DirectoryNotFoundException: Could not find a part of the path '/app/Kontranto.Web.API_Release/
1 Reply
Karlo
Karlo7mo ago
I have my GOOGLE_APPLICATION_CREDENTIALS in the heroku as a config var
Want results from more Discord servers?
Add your server