monaco-languageclient
monaco-languageclient copied to clipboard
Monaco editor core compatibility
The problem:
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; cause error in typescript project with monaco-editor-core package only.
Hack solution:
tsconfig.json
"paths": {
"monaco-editor/*": ["../node_modules/monaco-editor-core/*"]
}
Would you like to use monaco-editor package as peer-dependency?
Also monaco-editor depends from monaco-editor-core, may be make a sense change types import to core?
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; cause error in typescript project with monaco-editor-core package only.
That's weird because this code shouldn't be in the output javascript
Also monaco-editor depends from monaco-editor-core, may be make a sense change types import to core?
monaco-editor-core is not a dependency of monaco-editor, it's just there during the build and everything is duplicated/built from it, so it's not possible
We changed the dependency from monaco-editor-core to monaco-editor in the examples, because "limiting" the dependency to monaco-editor-core prevents users the simply include other monaco-editor features without requiring hacks.
Our reasoning was simple. You can achieve the same by importing a sub-set of monaco-editor instead of relying to monaco-editor-core.
That's weird because this code shouldn't be in the output javascript
It's error from typing d.ts files. monaco-editor-core or monaco-editor should be a devDependency, because typing files (for developing mode) have imports from that module.
It's error from typing d.ts files. monaco-editor-core or monaco-editor should be a devDependency
Thank you, this devDependency was never stated in the package.json of the lib (core or not), so at least I wasn't aware there was an impact beyond the examples.
@BusinessDuck due to the latest changes with v2.0.0+ we have a direct dependency to monaco-editor. See npm list output with depth 1:
└─┬ [email protected] -> .\packages\client
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
└─┬ vscode@npm:@codingame/[email protected]
└── [email protected]
We will add a workaround section to the README to make the problem visible to people, but we recommend to use monaco-editor and selectively import what is required.
We have added a new Troubleshooting section in the README that also provides help regarding monaco-editor-core.