Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get access to the slide show using global slidev #295

Closed
xingminw opened this issue Jul 6, 2021 · 3 comments
Closed

Cannot get access to the slide show using global slidev #295

xingminw opened this issue Jul 6, 2021 · 3 comments

Comments

@xingminw
Copy link

xingminw commented Jul 6, 2021

Describe the bug

I try to use slidev globally. It worked well for both the installation and creating new project, but I cannot get access to the localhost slide show at last.

To Reproduce
Steps to reproduce the behavior:

Installation

npm i -g @slidev/cli
npm i -g @slidev/theme-seriph

Create new env

slidev

Here is what I got:

D:\slidev-global>slidev
√ Entry file "slides.md" does not exist, do you want to create it? ... yes



  ●■▲
  Slidev  v0.22.1

  theme   @slidev/theme-seriph
  entry   D:\slidev-global\slides.md

  slide show      > http://localhost:3030/
  presenter mode  > http://localhost:3030/presenter
  remote control  > pass --remote to enable

  shortcuts       > restart | open | edit


Unrestricted file system access to "C:/Users/xxx/AppData/Roaming/npm/node_modules/@slidev/cli/node_modules/@slidev/client/main.ts"
For security concerns, accessing files outside of serving allow list will be restricted by default in the future version of Vite. Refer to https://vitejs.dev/config/#server-fs-allow for more details.
[@vue/compiler-sfc] <script setup> is still an experimental proposal.
Follow its status at https://github.com/vuejs/rfcs/pull/227.

[@vue/compiler-sfc] When using experimental features,
it is recommended to pin your vue dependencies to exact versions to avoid breakage.

Unrestricted file system access to "/Users/xxx/AppData/Roaming/npm/node_modules/@slidev/cli/node_modules/vite/dist/client/client"

After refreshing the webpage, I got further info:

7:14:53 PM [vite] Internal server error: Failed to resolve import "vue" from "..\@server-ref\state". Does the file exist?
  Plugin: vite:import-analysis
  File: /@server-ref/state
  1  |
  2  |  import { ref, watch } from "vue"
     |                              ^
  3  |
  4  |  const data = ref({"page":0,"clicks":0})
      at formatError (C:\Users\xxx\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:50135:46)
      at TransformContext.error (C:\Users\XX\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:50131:19)
      at normalizeUrl (C:\Users\xxx\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:73409:26)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)
      at async TransformContext.transform (C:\Users\xingm\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:73542:57)
      at async Object.transform (C:\Users\xxx\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:50336:30)
      at async transformRequest (C:\Users\xxx\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:65952:29)
      at async viteTransformMiddleware (C:\Users\xxx\AppData\Roaming\npm\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-cc49d7be.js:66090:32)
7:15:12 PM [vite] Internal server error: Failed to resolve import "vue" from "..\@server-ref\state". Does the file exist?

Desktop (please complete the following information):

  • OS: Win 10
  • Browser: Chrome
  • Slidev version:
@ZhiruiLi
Copy link

ZhiruiLi commented Aug 3, 2021

Same error here. Also fail when exporting:

C:\Users\xxx\slides> slidev export .\mytalk.md


  ●■▲
  Slidev  v0.22.7

  theme   @slidev/theme-default
  entry   C:\Users\xxx\slides\mytalk.md


  ◆ rendering █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1/26下午1:50:56 [vite] Internal server error: The request url "C:/Users/xxx/scoop/persist/nodejs/bin/nod:
- /C:/Users/xxx/OneDrive/notes/talks
- /C:/Users/xxx/scoop/persist/nodejs/bin/node_modules/@slidev/cli/node_modules/vite/dist/client

Refer to docs https://vitejs.dev/config/#server-fs-allow for configurations and more details.
      at ensureServingAccess (C:\Users\xxx\scoop\persist\nodejs\bin\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-c1a9de64.js:66669)
      at viteServeRawFsMiddleware (C:\Users\xxx\scoop\persist\nodejs\bin\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-c1a9de64.js:)
      at call (C:\Users\xxx\scoop\persist\nodejs\bin\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-c1a9de64.js:54742:7)
      at next (C:\Users\xxx\scoop\persist\nodejs\bin\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-c1a9de64.js:54686:5)
      at viteTransformMiddleware (C:\Users\xxx\scoop\persist\nodejs\bin\node_modules\@slidev\cli\node_modules\vite\dist\node\chunks\dep-c1a9de64.js:6)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
  ◆ rendering █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1/26

@ivaquero
Copy link

Similar problem

Slidev  v0.23.0 (global)

  theme   @slidev/theme-seriph
  entry   /Users/xxx/Documents/my_projects/works-show/slides.md

  slide show      > http://localhost:3030/
  presenter mode  > http://localhost:3030/presenter
  remote control  > pass --remote to enable

  shortcuts       > restart | open | edit


3:15:22 PM [vite] Internal server error: The request url "/Users/xxx/.config/yarn/global/node_modules/@slidev/client/main.ts" is outside of Vite serving allow list:

- /Users/xxx/.config/yarn/global/node_modules/@slidev/cli
- /Users/xxx/.config/yarn/global/node_modules/vite/dist/client

Refer to docs https://vitejs.dev/config/#server-fs-allow for configurations and more details.
      at ensureServingAccess (/Users/xxx/.config/yarn/global/node_modules/vite/dist/node/chunks/dep-874085d4.js:65300:15)
      at viteServeRawFsMiddleware (/Users/xxx/.config/yarn/global/node_modules/vite/dist/node/chunks/dep-874085d4.js:65267:13)
      at call (/Users/xxx/.config/yarn/global/node_modules/vite/dist/node/chunks/dep-874085d4.js:54167:7)
      at next (/Users/xxx/.config/yarn/global/node_modules/vite/dist/node/chunks/dep-874085d4.js:54111:5)
      at viteTransformMiddleware (/Users/xxx/.config/yarn/global/node_modules/vite/dist/node/chunks/dep-874085d4.js:65538:9)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
^C

@ivaquero
Copy link

@antfu Thank you, Anthony ! You are a lifesaver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants