monaco-languageclient icon indicating copy to clipboard operation
monaco-languageclient copied to clipboard

nextjs + electronjs

Open dxgi opened this issue 1 year ago • 4 comments

image

ReferenceError: window is not defined
    at file:///C:/Users/User/Desktop/redacted-electron/node_modules/vscode/vscode/src/vs/base/browser/window.js:9:20
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15) {
        page: '/'
    }
import { MonacoEditorReactComp } from '@typefox/monaco-editor-react';

export default function Editor() {
    return (
        <MonacoEditorReactComp
            userConfig={{
                wrapperConfig: {
                    editorAppConfig: {
                        $type: 'extended',
                        codeResources: {
                            main: {
                                uri: 'a',
                                text: 'a'
                            }
                        }
                    }
                }
            }}
            style={{
                height: '100%'
            }}/>
    );
}

dxgi avatar Jul 16 '24 17:07 dxgi

solved with the following code:

const MonacoEditorReactComp = dynamic(() => import('@typefox/monaco-editor-react').then(mod => mod.MonacoEditorReactComp), { ssr: false });

image

seems to be connecting to the lsp just fine however cant seem to make it provide anything, its just blank.

image

dxgi avatar Jul 16 '24 18:07 dxgi

seems to be connecting to the lsp just fine however cant seem to make it provide anything, its just blank.

Hi @dxgi do you mean the editor does not contain text or that nothing works (e.g. code completion)?

kaisalmen avatar Aug 08 '24 08:08 kaisalmen

nothing works, not even code completion even though provided from the language server protocol im using

dxgi avatar Aug 08 '24 11:08 dxgi

@dxgi are you sure you are using the correct languageId.

Package @codingame/monaco-vscode-lua-default-extension required for syntax highlighting expects lua as languageId

kaisalmen avatar Aug 08 '24 11:08 kaisalmen

Not a library issue.

kaisalmen avatar Aug 30 '24 13:08 kaisalmen