Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Sourcegraph phabricartor extension blocked by CORS policy #42555

@goddenrich

Description

@goddenrich
  • Sourcegraph version: 4.0.0 (enterprise)
  • Platform information: kubernetes deployment, Chrome Version 105.0.5195.125

Steps to reproduce:

  1. Install phabricator sourcegraph extension within phorge instance as per https://github.com/sourcegraph/phabricator-extension
  2. set corsOrigin correctly on sourcegraph instance
  3. set sourcegraph.enabled to true on phorge
  4. set sourcegraph url to self hosted sourcegraph instance

Expected behavior:

extensions shows data from sourcegraph

Actual behavior:

extension cant conntect to sourcegraph as it is blocked by CORS policy

[phorge-url]/:1 Access to fetch at 'https://[sourcegraph-url]/.assets/extension/css/style.bundle.css?v=0.0.0' from origin 'https://[phorge-url]' 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.
VM376:1          GET https://[sourcegraph-url]/.assets/extension/css/style.bundle.css?v=0.0.0 net::ERR_FAILED 200
(anonymous) @ VM376:1
(anonymous) @ codeHost.tsx:720
DT @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
codeHost.tsx:720 Error initializing Phabricator integration TypeError: Failed to fetch
    at <anonymous>:1:876
    at codeHost.tsx:720:1
    at DT (codeHost.tsx:720:1)
    at Array.map (<anonymous>)
    at codeHost.tsx:720:1
    at codeHost.tsx:720:1
    at codeHost.tsx:720:1
    at codeHost.tsx:720:1
(anonymous) @ codeHost.tsx:720
Promise.catch (async)
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
[phorge-url]/:1 Access to fetch at 'https://[sourcegraph-url]/.assets/extension/css/style.bundle.css?v=0.0.0' from origin 'https://[phorge-url] 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.
VM376:1          GET https://[sorucegraph-url]/.assets/extension/css/style.bundle.css?v=0.0.0 net::ERR_FAILED 200
(anonymous) @ VM376:1
(anonymous) @ codeHost.tsx:720
DT @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720
(anonymous) @ codeHost.tsx:720

This used to happen on the chrome browser extension too so suspect the latest version of the extension hasn't been bundled with sourcegraph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions