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

socket.io polling request blocked by CORS policy in Electron #1813

Closed
brownsugar opened this issue Mar 24, 2022 · 0 comments · Fixed by #1815
Closed

socket.io polling request blocked by CORS policy in Electron #1813

brownsugar opened this issue Mar 24, 2022 · 0 comments · Fixed by #1815

Comments

@brownsugar
Copy link
Contributor

brownsugar commented Mar 24, 2022

Version

6.0.0-beta.21 and up

Browser and OS info

Electron 17.2.0 / MacOS 12.2.1

Steps to reproduce

  1. Install Quasar and set the configs for Election mode.
  2. Install @vue/devtools@6.0.0-beta.21
  3. Run quasar dev -m electron --devtools to start a development server.
  4. Now Vue Developer Tools window will popup first, next will be the main Quasar app window.
  5. Open Chrome dev tool in Quasar app window, we can see the error message:
Access to XMLHttpRequest at 'http://localhost:8098/socket.io/?EIO=4&transport=polling&t=N-x9F79' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

What is expected?

The Socket.io server should correctly handle CORS requests.

What is actually happening?

Request was blocked by the CORS policy.


Since Socket.io v3, CORS was disabled by default, when I update @vue/devtools from 6.0.0-beta.20 to 6.0.0-beta.21, the required version of socket.io dependency was updated from ^2.0.4 to ^4.4.0, and the socket.io server in electron-shell doesn't properly handle CORS.

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

Successfully merging a pull request may close this issue.

1 participant