Open
Description
Describe the bug
Building a slidev presentation as an SPA using bun run build
fails if the path or folder name contains whitespace.
Example path: C:\Users\z0187681\IT-Stuff\Visual Studio Code\Presi-Abschlussprojekt
Building leads to the following error:
$ slidev build
●■▲
Slidev v51.8.1
theme @slidev/theme-seriph
css engine unocss
entry C:\Users\z0187681\IT-Stuff\Visual Studio Code\Presi-Abschlussprojekt\slides.md
vite v6.3.5 building for production...
✓ 0 modules transformed.
✗ Build failed in 161ms
[vite:build-html] Could not load C:/Users/z0187681/IT-Stuff/Visual%20Studio%20Code/Presi-Abschlussprojekt/node_modules/@slidev/client/main.ts: ENOENT: no such file or directory, open 'C:\Users\z0187681\IT-Stuff\Visual%20Studio%20Code\Presi-Abschlussprojekt\node_modules\@slidev\client\main.ts'
file: C:/Users/z0187681/IT-Stuff/Visual Studio Code/Presi-Abschlussprojekt/index.html
at async open (node:internal/fs/promises:638:25)
at async Object.readFile (node:internal/fs/promises:1238:14)
at async Object.handler (file:///C:/Users/z0187681/IT-Stuff/Visual%20Studio%20Code/Presi-Abschlussprojekt/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:45843:27)
at async PluginDriver.hookFirstAndGetPlugin (file:///C:/Users/z0187681/IT-Stuff/Visual%20Studio%20Code/Presi-Abschlussprojekt/node_modules/rollup/dist/es/shared/node-entry.js:22131:28)
at async file:///C:/Users/z0187681/IT-Stuff/Visual%20Studio%20Code/Presi-Abschlussprojekt/node_modules/rollup/dist/es/shared/node-entry.js:21136:33
at async Queue.work (file:///C:/Users/z0187681/IT-Stuff/Visual%20Studio%20Code/Presi-Abschlussprojekt/node_modules/rollup/dist/es/shared/node-entry.js:22359:32) {
errno: -4058,
code: 'PLUGIN_ERROR',
syscall: 'open',
path: 'C:\\Users\\z0187681\\IT-Stuff\\Visual%20Studio%20Code\\Presi-Abschlussprojekt\\node_modules\\@slidev\\client\\main.ts',
pluginCode: 'ENOENT',
plugin: 'vite:build-html',
hook: 'transform',
id: 'C:/Users/z0187681/IT-Stuff/Visual Studio Code/Presi-Abschlussprojekt/index.html',
watchFiles: [
'C:/Users/z0187681/IT-Stuff/Visual Studio Code/Presi-Abschlussprojekt/index.html'
]
}
error: script "build" exited with code 1
Minimal reproduction
Steps to reproduce the behavior:
- Create a Slidev presentation with
bun create slidev
, preferably in a path without whitespace - Choose
test slidev
as the project name - Keep
test-slidev
as the package name - Notice that running
bun run dev
works fine - Try building with
bun run build
Trying the same thing with test-slidev
as project name leads to a successful build.
Environment
- Slidev version: 51.8.1
- Browser: Microsoft Edge / Zen (Firefox)
- OS: Windows 11
I'm not sure if this is a Slidev or a Vite problem. I just ran into it when trying to build my presentation and couldn't find any information about that problem.