Skip to content

Commit

Permalink
Fix @openctx/vscode-lib initialization for Cody Web (#4796)
Browse files Browse the repository at this point in the history
  • Loading branch information
vovakulikov authored Jul 5, 2024
1 parent 022db90 commit 8703316
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/shared/src/sourcegraph-api/completions/browserClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,8 @@ if (isRunningInWebWorker) {

document: self.document,
}
// HACK: @openctx/vscode-lib uses global object to share vscode API, it breaks cody web since
// global doesn't exist in web worker context, for more details see openctx issue here
// https://github.com/sourcegraph/openctx/issues/169
;(self as any).global = {}
}
1 change: 0 additions & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export default defineProjectWithDefaults(__dirname, {
build: {
// Turn off minification since it breaks json-rpc in inline web-worker in Safari
minify: false,
emptyOutDir: false,
outDir: 'dist',
assetsDir: '.',
reportCompressedSize: false,
Expand Down

0 comments on commit 8703316

Please sign in to comment.