slidev icon indicating copy to clipboard operation
slidev copied to clipboard

Failed to load source map for marked.js.

Open rcmosher opened this issue 6 months ago • 7 comments

Describe the bug

Running the default slide deck gives the error:

9:06:00 AM [vite] (client) Failed to load source map for /deckdir/slidev/node_modules/.pnpm/[email protected]/node_modules/monaco-editor/esm/vs/base/common/marked/marked.js.
Error: An error occurred while trying to read the map file at marked.umd.js.map
Error: ENOENT: no such file or directory, open '/deckdir/slidev/node_modules/.pnpm/[email protected]/node_modules/monaco-editor/esm/vs/base/common/marked/marked.umd.js.map'
    at async open (node:internal/fs/promises:638:25)
    at async Object.readFile (node:internal/fs/promises:1238:14)
    at async extractSourcemapFromFile (file:///deckdir/slidev/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-DZ2tZksn.js:8303:65)
    at async loadAndTransform (file:///deckdir/slidev/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-DZ2tZksn.js:26390:22)

Minimal reproduction

Steps to reproduce the behavior:

  1. npm i -g pnpm
  2. pnpm create slidev
  3. Finish steps to get the deck running
  4. Wait.
  5. Restart to get the error again.

Also occurs using local project npm create slidev@latest

Environment

  • Slidev version: v52.0.0
  • Browser: firefox
  • OS: Ubuntu (also reproduced in WSL)

If you are using Slidev globally (i.e. npx slidev or npm i -g slidev), please try to reproduce the issue in a local project (i.e. npm create slidev@latest).

rcmosher avatar Jul 14 '25 13:07 rcmosher

Same here:

pnpm: v10.13.1 node: v24.4.0

pnpm create slidev

  ●■▲
  Slidev Creator  v52.0.0

✔ Project name: … slidev-test2
  Scaffolding project in slidev-test2 ...
  Done.

✔ Install and start it now? … yes
✔ Choose the package manager › pnpm
Downloading [email protected]: 18.44 MB/18.44 MB, done
Downloading [email protected]: 14.12 MB/14.12 MB, done
Downloading [email protected]: 7.60 MB/7.60 MB, done
Packages: +630
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 674, reused 294, downloaded 336, added 630, done

dependencies:
+ @slidev/cli 52.0.0
+ @slidev/theme-default 0.25.0
+ @slidev/theme-seriph 0.25.0
+ vue 3.5.17

╭ Warning ───────────────────────────────────────────────────────────────────────────────────╮
│                                                                                            │
│   Ignored build scripts: esbuild.                                                          │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.   │
│                                                                                            │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

Done in 19.3s using pnpm v10.13.1

> slidev-test2@ dev /home/fernan/git/slidev-test2
> slidev --open



  ●■▲
  Slidev  v52.0.0

  theme       @slidev/theme-seriph
  css engine  unocss
  entry       /home/fernan/git/slidev-test2/slides.md

  public slide show   > http://localhost:3030/
  presenter mode      > http://localhost:3030/presenter/
  slides overview     > http://localhost:3030/overview/
  export slides       > http://localhost:3030/export/
  remote control      > pass --remote to enable

  shortcuts           > restart | open | edit | quit
5:19:15 PM [vite] (client) Failed to load source map for /home/fernan/git/slidev-test2/node_modules/.pnpm/[email protected]/node_modules/monaco-editor/esm/vs/base/common/marked/marked.js.
Error: An error occurred while trying to read the map file at marked.umd.js.map
Error: ENOENT: no such file or directory, open '/home/fernan/git/slidev-test2/node_modules/.pnpm/[email protected]/node_modules/monaco-editor/esm/vs/base/common/marked/marked.umd.js.map'
    at async open (node:internal/fs/promises:640:25)
    at async Object.readFile (node:internal/fs/promises:1277:14)
    at async extractSourcemapFromFile (file:///home/fernan/git/slidev-test2/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-DZ2tZksn.js:8303:65)
    at async loadAndTransform (file:///home/fernan/git/slidev-test2/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-DZ2tZksn.js:26390:22)

fernan avatar Jul 14 '25 17:07 fernan

Same here.

Using npm 11.5.1, pnpm 10.14.0 or bun 1.2.19 to create a new Sli.dev project is producing the same aftereffect.

javs1979 avatar Aug 01 '25 22:08 javs1979

Looks like this issue may be strongly related to a recent monaco-editor release (0.52.0). See https://github.com/microsoft/monaco-editor/issues/4712 for details.

Maybe reverting to the previous stable monaco-editor version will fix the current bug ?

javs1979 avatar Aug 02 '25 19:08 javs1979

same problem

FanBB2333 avatar Aug 04 '25 09:08 FanBB2333

same here

benjaminknauer avatar Aug 13 '25 12:08 benjaminknauer

I found a silly solution by copying marked.umd.js.map from

node_modules
└─ .pnpm
   └─ marked@<your-marked-js-version>
      └─ node_modules
         └─ marked
            └─ lib
               └─ marked.umd.js.map

and put it into

node_modules
└─ .pnpm
   └─ [email protected]
      └─ node_modules
         └─ monaco-editor
            └─ esm
               └─ vs
                  └─ base
                     └─ common
                        └─ marked
                           └─ marked.umd.js.map 

And the bug is gone.

LugoBlogger avatar Aug 15 '25 03:08 LugoBlogger

Workaround:

I am using pnpm, and by overriding the version of monaco-editor to previous stable version, the error will be gone.

# pnpm-workspace.yaml

overrides:
  monaco-editor: 0.51.0

Related issue: https://github.com/microsoft/monaco-editor/issues/4712 Corresponding commit: https://github.com/slidevjs/slidev/commit/cf02b327628751a47b16875b7c84da0a26cb6197

LuckyWindsck avatar Aug 25 '25 09:08 LuckyWindsck

fixed in #2282 (workaround)

kermanx avatar Nov 16 '25 04:11 kermanx