slidevjs / slidev-vscode

VS Code extension for Slidev
https://marketplace.visualstudio.com/items?itemName=antfu.slidev
MIT License
255 stars 17 forks source link

command 'slidev.preview-refresh' not found #23

Closed FrancescoSaverioZuppichini closed 6 months ago

FrancescoSaverioZuppichini commented 8 months ago

Hi there :wave:

I've installed globally

npm i -g @slidev/cli

Then the extension but I got this error

Screenshot 2024-03-07 at 23 00 33

Thanks a lot 🤗

Fra

yu45020 commented 7 months ago

Same here. Installed globally but no preview. I then install manually following this instruction, and it works, and it works in vs code.

A simple fix: copy package.json to any folder with a markdown file. The extension works again. The two files can be generated by npm install @slidev/cli @slidev/theme-default

package.json file content

{
  "dependencies": {
    "@slidev/cli": "^0.49.0-beta.3",
    "@slidev/theme-default": "^0.25.0"
  }
}
KermanX commented 7 months ago

This is because Slidev cannot make sure it is a "Slidev Markdown" or a common markdown when there is no package.json indicating this. A simpler workaround could be setting slidev.enabled to true in the workspace settings.

KermanX commented 6 months ago

We've rewritten the VSCode extension for Slidev (https://github.com/slidevjs/slidev/pull/1557). Upgrading the VSCode extension to the latest (0.49.1) can fix this issue.