JavaScript influxdb-client react web app CORS issue

I assume you know what CORS is?
CORS errors are a common problem when developing frontend applications locally together with APIs.

I guess one of the two possibilities could solve your problem:

1.) Instead of opening the index.html on localhost directly in the browser, also start a simple web server on localhost. For example:

python -m SimpleHTTPServer

Or if you use Visual Studio Code, install the plugin Live Server, start it and open your web app on localhost.

OR

2.) Allow CORS on the server running InfluxDB