microsoft / microsoft/monaco-editor

[Bug] loader.js source mapping issue when loader.config with custom source map files in 0.55.1

Open
#5,211 1 comment 0 reactions 0 assignees View on GitHub

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?
Monaco Editor Playground Link

When configure loader with custom vs path like this

import Editor, { loader } from "@monaco-editor/react";

loader.config({ paths: { vs: `node_modules/monaco-editor/min/vs` } });

So during component loading, it shows error in terminal console.

7:12:31 pm [vite] (client) Failed to load source map for /home/project/node_modules/.pnpm/monaco-editor@0.55.1/node_modules/monaco-editor/min/vs/loader.js.
Error: An error occurred while trying to read the map file at ../../min-maps/vs/loader.js.map
Error: ENOENT: no such file or directory, open ' /home/project/node_modules/.pnpm/monaco-editor@0.55.1/node_modules/monaco-editor/min-maps/vs/loader.js.map'
    at async open (node:internal/fs/promises:637:25)
    at async Object.readFile (node:internal/fs/promises:1269:14)
    at async extractSourcemapFromFile (file:///var/ /home/project/node_modules/.pnpm/vite@7.3.1_@types+node@24.1.0_lightningcss@1.30.1_sass@1.77.8_terser@5.46.0/node_modules/vite/dist/node/chunks/config.js:8050:65)
    at async loadAndTransform (file:///var/ /home/projectnode_modules/.pnpm/vite@7.3.1_@types+node@24.1.0_lightningcss@1.30.1_sass@1.77.8_terser@5.46.0/node_modules/vite/dist/node/chunks/config.js:22641:22)

Monaco Editor Playground Code

Reproduction Steps

No response

Actual (Problematic) Behavior

No response

Expected Behavior

No response

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the custom loader.config paths case and inspect node_modules/monaco-editor/min/vs/loader.js together with the referenced min-maps/vs/loader.js.map path. Check how the source map is resolved during loading, then verify that the configured loader no longer produces the missing-map error in Vite.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, vite
Domain
frontend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.