diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx index 2a69161bef..558dec7734 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx @@ -15,7 +15,8 @@ import { noop } from 'lodash-es' import { basePath } from '@/utils/var' // load file from local instead of cdn https://github.com/suren-atoyan/monaco-react/issues/482 -loader.config({ paths: { vs: `${basePath}/vs` } }) +if (typeof window !== 'undefined') + loader.config({ paths: { vs: `${window.location.origin}${basePath}/vs` } }) const CODE_EDITOR_LINE_HEIGHT = 18