fix: Code editor throws dozen of errors (#28500)

This commit is contained in:
非法操作 2025-11-21 16:48:35 +08:00 committed by GitHub
parent 2e0964e0b0
commit 9fed2dc065
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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