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

CORS issue #3

Open
roestigraben opened this issue Apr 21, 2023 · 3 comments
Open

CORS issue #3

roestigraben opened this issue Apr 21, 2023 · 3 comments

Comments

@roestigraben
Copy link

I have the package working very fine on Postman as well as in my app provided for I use the CORS plugin on Chrome.
So essentially I believe I have a problem with CORS.
This plugin on Chrome is not recommendable for other than a quick and dirty check.

When I don't use the plugin, I get a error message in the console:

Uncaught (in promise) TypeError: Failed to fetch
at Query......

when I follow the link of the failure, I see that it points to the fetch command
const result = await fetch(${ENTSOE_ENDPOINT}?${query})

I am trying since > 1 day to resolve but I am not able.

@Hexagon
Copy link
Owner

Hexagon commented Apr 21, 2023

Oh, are you running this lib on the client side (browser)? Never tried that

@roestigraben
Copy link
Author

Hey, you baptised the package client, hence I assumed it would be for this purpose.

Maybe I had to hack a few things, I don't remember.

Anyway, for any help on the CORS issue, I would be happy to see a solution.

I tried on a pretty empty test with only the URL construct and the headers feeding into a fetch, but to no success.
I read everywhere that I would need to add something to the server side on which evidentely I don't have access

BTW I also fetch some wind data from an API from Meteomatics and I face similar issues.

@fetimo
Copy link
Contributor

fetimo commented May 29, 2023

Hi @roestigraben, I highly recommend using this package as part of your back-end. Using it in the browser will expose your security token and bring up CORS issues, like you found. This article explains more on CORS and what it means.

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