slidev icon indicating copy to clipboard operation
slidev copied to clipboard

VSCode Extension doen't sync preview and imported document

Open jesustorresdev opened this issue 4 weeks ago • 2 comments

Describe the bug

I have a multimedia.md slides document with every section imported from a file in pages directory. Then changes in those documents don't update the preview. Only it is updated when I go to the main document and press Ctrl+S to try to save it.

jesustorresdev avatar Nov 01 '25 18:11 jesustorresdev

Does this also happen when accessing localhost:3030 directly in your browser?

kermanx avatar Nov 02 '25 06:11 kermanx

After some testing, I've found that the problem isn't related to the file being imported, but rather to it being in a subdirectory (for example, ./pages, as in the demo). Specifically:

  • Synchronization of both the main file and the imported files works for both the preview and the browser view if they are in the project's root directory.

  • I haven't been able to get synchronization working for files in project subdirectories, neither in the preview nor in the browser.

  • If the main file is in the root directory, but the imported file is in a subdirectory, the file in the subdirectory isn't updated until a save is forced in the main file, even if it doesn't contain any changes. Saving the main file then synchronizes the imported file in both views.

jesustorresdev avatar Nov 02 '25 12:11 jesustorresdev

I am afraid that I can't reproduce the problem. Could you please create a reproduction on https://sli.dev/new?

kermanx avatar Nov 16 '25 05:11 kermanx