Skip to content

Commit 2bbd5c9

Browse files
authored
Merge pull request #4001 from DanielLeone/fix-base-url-with-monaco-editor
fix Monaco Editor with custom base url
2 parents 69241fc + 9cfa27f commit 2bbd5c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/components/monaco/MonacoEditorLoaderInitializer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import React, { useState } from 'react';
1919
import { useTranslation } from 'react-i18next';
2020
import { getBaseUrl } from '../../helpers/getBaseUrl';
2121
import { isElectron } from '../../helpers/isElectron';
22+
import { makeUrl } from '../../lib/k8s/api/v2/makeUrl';
2223

2324
/**
2425
* A React component which configures the monaco-editor loader to make sure
@@ -49,7 +50,7 @@ export function MonacoEditorLoaderInitializer({ children }: React.PropsWithChild
4950
// This needs to include the origin and not just a relative path because it is used as a fetch
5051
// from inside a web worker; which isn't allowed to fetch from relative paths.
5152
// The Vite configuration will copy the relevant source files into the served assets/vs/ folder
52-
let url = `${window.location.origin}/${getBaseUrl()}assets/vs`;
53+
let url = makeUrl([window.location.origin, getBaseUrl(), 'assets', 'vs']);
5354

5455
// If electron in the built app, get the base url from window.location.href
5556
// eg window.location.href

0 commit comments

Comments
 (0)