Skip to content

HMR blocked due to CORS #35

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

Closed
arnvanhoutte opened this issue May 12, 2020 · 6 comments
Closed

HMR blocked due to CORS #35

arnvanhoutte opened this issue May 12, 2020 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@arnvanhoutte
Copy link

arnvanhoutte commented May 12, 2020

I cloned the project from here and didn't really change much. The project builds and starts fine but I saw this error in my dev tools:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://192.168.1.54:8080/sockjs-node/info?t=1589278796344. (Reason: CORS request did not succeed).

The issue is probably caused by the request going to the IP address instead of localhost, but I am not sure where to change this
image

@liborpansky
Copy link
Contributor

liborpansky commented May 12, 2020

Hi, can you confirm you are using ASP.NET Core app URL at http://localhost:5000/ (in your case http://192.168.1.54:5000) instead of vue app URL at port 8080?
Plus HMR does not work with https, you should use http endpoint.

@arnvanhoutte
Copy link
Author

I just started the app with my IIS Express config, so https://localhost:44352/ in this case

@liborpansky
Copy link
Contributor

Try to run the site with http only and let me know if your problem persists :)

@arnvanhoutte
Copy link
Author

It works with HTTP, but ideally our application should work in HTTPS-mode. I also have an Angular project that uses HMR/Sock-JS and that one uses HTTPS with no issue because it just talks to my localhost, instead to a specific IP

@liborpansky
Copy link
Contributor

There were some attempts to support HTTPS in dev environment #24 , but I've actually never seen a working project with ASP.NET / Vue...

@arnvanhoutte
Copy link
Author

Ah that's too bad. Hopefully someone can figure it out soon

@liborpansky liborpansky added the duplicate This issue or pull request already exists label May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants