getcursor / cursor

The AI-powered code editor
https://cursor.sh
20.55k stars 1.38k forks source link

CORS error when installing extensions in Cursor.sh using devcontainers #1477

Open vasco opened 4 weeks ago

vasco commented 4 weeks ago

I'm encountering a problem while setting up a Python project in Cursor.sh using devcontainers. During the extension installation process, Cursor.sh gets stalled and doesn't proceed further. The issue seems to be related to a Cross-Origin Resource Sharing (CORS) error. Steps to Reproduce:

  1. Set up a Python project in Cursor.sh using devcontainers.
  2. Configure the devcontainer.json file with the necessary extensions and settings.
  3. Start the devcontainer build process.
  4. Observe that Cursor.sh gets stalled during the extension installation step.

Expected Behavior: Cursor.sh should successfully install all the specified extensions and complete the devcontainer setup process without any CORS-related errors.

Actual Behavior: Cursor.sh encounters a CORS error during the extension installation process and gets stalled indefinitely. The developer tools show the following error messages:

Access to XMLHttpRequest at 'https://marketplace.cursorapi.com/_apis/public/gallery/extensionquery' from origin 'vscode-file://vscode-app' 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.

Failed to load resource: https://marketplace.cursorapi.com/_apis/public/gallery/extensionquery:1 net::ERR_FAILED

Screenshots: CleanShot 2024-06-03 at 18 25 01

Operating System

Additional Information:

I suspect that the problem is related to the CORS configuration on the https://marketplace.cursorapi.com server. It seems that the server is not sending the necessary Access-Control-Allow-Origin header in the response, causing the browser to block the request.

I would appreciate any guidance or assistance in resolving this CORS issue and enabling smooth extension installation in Cursor.sh using devcontainers.