microsoft / microsoft/monaco-editor
[Bug] Cannot redeclare block-scoped variable 'Map'.
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
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
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `let Map = new Set();`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "typescript",
automaticLayout: true,
});
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
target: monaco.languages.typescript.ScriptTarget.ES2019,
module: monaco.languages.typescript.ModuleKind.ESNext,
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
strict: false,
strictFunctionTypes: false,
strictBindCallApply: false,
noStrictGenericChecks: false,
noImplicitAny: false,
importHelpers: true,
allowNonTsExtensions: true,
});
Reproduction Steps
No response
Actual (Problematic) Behavior
Cannot redeclare block-scoped variable 'Map'.
Expected Behavior
No error
Additional Context
No response
Contributor 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.
Research direction
Start with the linked Monaco Editor Playground reproduction and its embedded TypeScript code and compiler options. Trace where the redeclaration diagnostic for Map is produced, then verify the playground no longer reports the error with the shown configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100