slidev icon indicating copy to clipboard operation
slidev copied to clipboard

VSCode extension doesn't work if .md filename contains a space

Open markhavemann opened this issue 9 months ago • 5 comments

VScode extension doesn't work after following instructions on extension page.

Starting the dev server gives the error in console:

npm error code EUSAGE

and in the preview pane:

Slidev server for [name of my file] not found on http://localhost:3030. (TypeError: fetch failed) Please check the server status.

Minimal reproduction

Steps to reproduce the behavior:

  1. Open VSCode
  2. Install the plugin
  3. Enable the icon in the activity bar by forcing enable on slidev in settings.json because it doesn't show up by default
  4. click on icon
  5. click start Dev Server

I've tried reinstalling the extension multiple times, as well as following instructions to install through npm manually.

Environment

  • Slidev version:
  • Browser:
  • OS: Windows

markhavemann avatar Apr 14 '25 05:04 markhavemann

I think I might have solved this, maybe... Your .md file can ONLY be called slides.md, otherwise you will get errors?

I'm honestly still a little mystified so I won't close this.

I'm confused because the website talks about reusability of slides but if I'm right about why the server wasn't starting, then you're limited to one single slideshow per folder/project and the main file must be called slides.md AND must be in the home directory of the project with a very strictly named folder structure for other components.

But on this page (https://sli.dev/features/importing-slides) the website gives an example of including slides from another project NOT named slides.md in a sub folder of the current project.

Maybe someone can clarify?

markhavemann avatar Apr 14 '25 07:04 markhavemann

Ok I think I've figured out the issue.

I copied an existing project that I was working as a basis for a new slideshow. I changed the name of the .md file and one or two lines in the file itself. All of a sudden the server wouldn't start either.

After a bit of messing around I realised there was a space in the name of the newly copied .md file, but no space in the old one. I removed the space and suddenly it worked.

markhavemann avatar Apr 20 '25 01:04 markhavemann

I can confirm that the same problem occurs in *nix environment if you use a project inside a folder that is accessed via a symbolic link.

diego-betto avatar Sep 11 '25 08:09 diego-betto

Same behaviour when the slides.md file is a symbolic link to another folder.

cyanescent avatar Sep 22 '25 02:09 cyanescent

I think I might have solved this, maybe... Your .md file can ONLY be called slides.md, otherwise you will get errors?

Any file name should be supported. However, in VSCode, to not confuse with other non-Slidev markdown files, only slides.md is considered as a Slidev markdown by default, and you can add other file name patterns by setting slidev.include.

As for the error when the file path contains whitespace, this is a bug.

kermanx avatar Nov 14 '25 09:11 kermanx