slidevjs / slidev-vscode

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

Cannot find the button on the sidebar #6

Closed ivaquero closed 3 years ago

ivaquero commented 3 years ago

Hi, this is a good alternative to Reveal.js. It works well in the external browser. However, I cannot find the button on the sidebar. I have no clue of the cause.

image

Besides, there is an alert.

image

antfu commented 3 years ago

You will need to have @slidev/cli dep in your root package.json to enable the extension

ivaquero commented 3 years ago

I guess I had installed it... I can debug, but still not sure what is wrong with this. BTW, I used yarn, will yarn cause problems?

image

the error log is as follows:

0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '/usr/local/Cellar/node/16.3.0/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'run', 1 verbose cli 'build' 1 verbose cli ] 2 info using npm@6.14.13 3 info using node@v16.3.0 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle text_slides@~prebuild: text_slides@ 6 info lifecycle text_slides@~build: text_slides@ 7 verbose lifecycle text_slides@~build: unsafe-perm in lifecycle true 8 verbose lifecycle text_slides@~build: PATH: /Users/integrator/.config/yarn/global/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/integrator/Documents/my_projects/notes-math/text_slides/node_modules/.bin:/Applications/Polyspace/R2019a/bin:/Library/TeX/texbin:/usr/local/opt/sqlite/bin:/usr/local/opt/ruby/bin:/usr/local/opt/gettext/bin:/usr/local/opt/curl/bin:/usr/local/share/npm/bin:/usr/local/sbin:/usr/local/Caskroom/miniconda/base/bin:/usr/local/Caskroom/miniconda/base/condabin:/usr/local/opt/protobuf@3.7/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/opt/curl/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/gettext/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/usr/local/opt/fzf/bin 9 verbose lifecycle text_slides@~build: CWD: /Users/integrator/Documents/my_projects/notes-math/text_slides 10 silly lifecycle text_slides@~build: Args: [ '-c', 'slidev build' ] 11 silly lifecycle text_slides@~build: Returned: code: 1 signal: null 12 info lifecycle text_slides@~build: Failed to exec build script 13 verbose stack Error: text_slides@ build: slidev build 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/Users/integrator/.config/yarn/global/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose stack at EventEmitter.emit (node:events:394:28) 13 verbose stack at ChildProcess. (/Users/integrator/.config/yarn/global/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (node:events:394:28) 13 verbose stack at maybeClose (node:internal/child_process:1067:16) 13 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) 14 verbose pkgid text_slides@ 15 verbose cwd /Users/integrator/Documents/my_projects/notes-math/text_slides 16 verbose Darwin 20.5.0 17 verbose argv "/usr/local/Cellar/node/16.3.0/bin/node" "/usr/local/bin/npm" "run" "build" 18 verbose node v16.3.0 19 verbose npm v6.14.13 20 error code ELIFECYCLE 21 error errno 1 22 error text_slides@ build: slidev build 22 error Exit status 1 23 error Failed at the text_slides@ build script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

antfu commented 3 years ago

In your root package.json, or you can open up the folder instead of the workspace

ivaquero commented 3 years ago

Oh, right, I just found my root package.json lost. Thank you for your time.

antfu commented 3 years ago

Closing this for now, til we find a better solution to detect the existence of Slidev. Thanks.

ivaquero commented 3 years ago

@antfu Hello again, Anthony! Instead of using the preview on side panel, I think using your Browse Lite extension could be another good choice. So could you please consider to add a method to pass http://localhost:3030/ to Browse Lite ? This enables us to start a slidev project in a subfolder, at least for this moment.

image

antfu commented 3 years ago

Contribution welcome, refer https://github.com/antfu/vscode-vite/blob/57f6c6b6978b635bd25ab511744a8b5219fcf2f1/src/open.ts#L21-L29