question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XMLHttpRequest from origin 'http://127.0.0.1:8080' has been blocked by CORS policy

See original GitHub issue

Hi @mullermarian, I have been stuck a while with a security problem from the Web UI.

Describe the bug No way to load successfully the Web UI and use STUdio. Some error messages are on the screen and the Web UI doesn’t load the locales

Looks like the same closed issue #9

To Reproduce Nothing special, just follow the Readme and the right requirements. Launch the script and load the Web UI through Firefox or Chrome in their lastest versions.

Screenshots studio_cors_policy

Logs from the Chrome DevTools (index):1 Access to XMLHttpRequest at 'http://localhost:8080/locales/en/translation.json' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. localhost:8080/locales/en/translation.json:1 Failed to load resource: net::ERR_FAILED (index):1 Access to XMLHttpRequest at 'http://localhost:8080/locales/fr/translation.json' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. App.js:49 Setting up vert.x event bus... localhost:8080/locales/fr/translation.json:1 Failed to load resource: net::ERR_FAILED (index):1 Access to fetch at 'http://localhost:8080/api/device/infos' from origin 'http://127.0.0.1:8080' 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. localhost:8080/api/device/infos:1 Failed to load resource: net::ERR_FAILED

Desktop and environment

  • OS: Windows 10 1909 x64
  • Browser Chrome v81 x64 & Firefox 75 x64
  • Java version: JDK 11+
  • STUdio application version 0.1.13

Additional context Script hosted locally on Windows 10 or on a remote Linux Server. Same issue from a client web browser in Windows 10.

Solution Temporary solution found : disable web security when startup Chrome

Launch Chrome from CMD without web security 👍

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=%UserProfile%​

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SuperTomacommented, Apr 23, 2020

I think that if you enter in your web navigator http://localhost:8080/ (as described in the readme) instead of http://127.0.0.1:8080/ it will works 😃

0reactions
marian-m12lcommented, Apr 24, 2020

I’ll try to improve this at some point, but tbh that’s pretty low priority.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found