[Bug] Error: [createInstance] CodeLensContribution depends on UNKNOWN service ICodeLensCache.
Maintainers usually reply within 1 day
@hediet is already working on this.
Since Sep 29, 2026.
Assessment
This issue has not been assessed yet.
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
I'm using 0.57.0 along with monaco-editor-webpack-plugin.
My monaco-editor-webpack-plugin config looks like this:
new MonacoWebpackPlugin({
languages: ['json', 'html', 'javascript'],
filename: getFileName('js', 'worker'),
features: [
'!caretOperations',
'!codeAction',
'!codelens', // BUG RELATED
'!colorPicker',
'!dnd',
'!gotoSymbol',
'!linkedEditing',
'!multicursor',
'!referenceSearch',
'!smartSelect',
'!snippet',
'!stickyScroll',
'!toggleHighContrast',
'!inlineCompletions',
'!inlineProgress',
]
})
I create Monaco editors with this config:
export const defaultEditorOptions = {
minimap: { enabled: false },
scrollBeyondLastLine: false,
lineNumbers: 'off',
renderLineHighlight: 'none',
selectOnLineNumbers: true,
automaticLayout: true,
theme: 'defaultTheme',
scrollbar: { alwaysConsumeMouseWheel: false },
renderValidationDecorations: 'on',
codeLens: false, // BUG RELATED
};
When I instantiate an editor, it does render on my page but sometimes without styling the text. Furthermore, there are console errors like this. I was previously on 0.52.0 and didn't have this problem. I ran into it while testing the upgrade to 0.57.0.
errors.js:15 Uncaught Error: [createInstance] CodeLensContribution depends on UNKNOWN service ICodeLensCache.
Error: [createInstance] CodeLensContribution depends on UNKNOWN service ICodeLensCache.
at InstantiationService._throwIfStrict (instantiationService.js:333:1)
at InstantiationService._createInstance (instantiationService.js:114:1)
at InstantiationService.createInstance (instantiationService.js:102:1)
at CodeEditorContributions._instantiateById (codeEditorContributions.js:120:1)
at CodeEditorContributions._instantiateSome (codeEditorContributions.js:98:1)
at eval (codeEditorContributions.js:46:1)
at InstantiationService._throwIfStrict (instantiationService.js:333:1)
at InstantiationService._createInstance (instantiationService.js:114:1)
at InstantiationService.createInstance (instantiationService.js:102:1)
at CodeEditorContributions._instantiateById (codeEditorContributions.js:120:1)
at CodeEditorContributions._instantiateSome (codeEditorContributions.js:98:1)
at eval (codeEditorContributions.js:46:1)
at eval (errors.js:15:1)
I would expect since I have codeLens disabled in webpack and codeLens disabled on the editor options, that nothing would try to instantiate codeLens! Debugging in my browser, I see "css.editor.codeLens" is the ID trying to create it, which also makes no sense since I never tell Monaco to use CSS:
Monaco Editor Playground Code
Reproduction Steps
No response
Actual (Problematic) Behavior
No response
Expected Behavior
No response
Additional Context
No response
- Dominant language
- JavaScript
- Stars
- 47k
- Forks
- 4.2k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 13
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/monaco-editor
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
microsoft/monaco-editor#5626 ·
Maintainers usually reply within 1 day
-
[Bug] package.json `"typings"` points to a file which does not exist in the npm packagePossibly taken @whoalin1 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/monaco-editor#5615 ·
Maintainers usually reply within 1 day
-
[Bug] C# scientific-notation literals without a decimal point are split into identifiersPossibly taken @Janani-bn claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/monaco-editor#5583 ·
Maintainers usually reply within 1 day
-
[Bug] Rust scientific-notation literals without an exponent sign are split into identifiersPossibly taken @Janani-bn claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/monaco-editor#5582 ·
Maintainers usually reply within 1 day
-
[Bug] Go numeric literals with underscore separators are split into identifiersMay be free again @aaronanish-t claimed this 25 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
microsoft/monaco-editor#5577 · 1 comment ·
Maintainers usually reply within 1 day
All issues in microsoft/monaco-editor
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quasarframework/quasar#18614 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug/1-unconfirmed kind/bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
521xueweihan/HelloGitHub#4714 ·
-
01 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day