slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
33.49k stars 1.37k forks source link

npm run dev => UnhandledPromiseRejectionWarning #4

Closed reazan closed 3 years ago

reazan commented 3 years ago

Hello, I was so curious about slidev that I jumped in immediately! (✧ω✧)

I have a problem with "npm run dev" When I execute it I got:


(node:9240) UnhandledPromiseRejectionWarning: Error: Path contains invalid characters: D:\Ramen\Projects\slidev-test/D:/Ramen/Projects/slidev-test/node_modules/.remote-assets
    at checkPath (D:\Ramen\Projects\slidev-test\node_modules\fs-extra\lib\mkdirs\make-dir.js:20:21)
    at module.exports.makeDir (D:\Ramen\Projects\slidev-test\node_modules\fs-extra\lib\mkdirs\make-dir.js:45:3)
    at Object.defineProperty.value (D:\Ramen\Projects\slidev-test\node_modules\universalify\index.js:21:45)
    at Object.configResolved (D:\Ramen\Projects\slidev-test\node_modules\vite-plugin-remote-assets\dist\index.js:351:32)
    at D:\Ramen\Projects\slidev-test\node_modules\vite\dist\node\chunks\dep-2c03f3f9.js:46156:127
    at Array.map (<anonymous>)
    at resolveConfig (D:\Ramen\Projects\slidev-test\node_modules\vite\dist\node\chunks\dep-2c03f3f9.js:46156:35)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async createServer (D:\Ramen\Projects\slidev-test\node_modules\vite\dist\node\chunks\dep-2c03f3f9.js:69168:20)
    at async createServer (D:\Ramen\Projects\slidev-test\node_modules\@slidev\cli\dist\chunk-2DUYQIA7.js:13:18)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9240) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:9240) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

System: Windows10 Node: v14.16.1 Npm: v7.0.5

What I did:

added 225 packages, and audited 225 packages in 22s

30 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

It is something that could be on my side to check? Thanks in advance, kind regards

antfu commented 3 years ago

Will have a look and add more tests for Windows 🤣

antfu commented 3 years ago

Not sure if 0.1.3 would be a fix, would be appreciated if you can have a try. Don't have a Windows right now for me to test out 🥲

reazan commented 3 years ago

Ok, I've installed the v0.1.3 and "npm run dev" works nicely. (๑˃ᴗ˂)ﻭ

Slidev  v0.1.3

theme   @slidev/theme-seriph
entry   D:\Ramen\Projects\slidev-test\slides.md

slide show      > http://localhost:3030/
presenter mode  > http://localhost:3030/presenter
remote control  > http://172.16.0.11:3030/presenter
remote control  > http://192.168.1.94:3030/presenter

I went on http://localhost:3030/ but it is all blank. Console side I got this error:

Failed to load resource: the server responded with a status of 404 (Not Found) on http://localhost:3030/@fsD:/Ramen/Projects/slidev-test/node_modules/@slidev/client/main.ts

Thanks again!

bram-pkg commented 3 years ago

Ok, I've installed the v0.1.3 and "npm run dev" works nicely. (๑˃ᴗ˂)ﻭ

Slidev  v0.1.3

theme   @slidev/theme-seriph
entry   D:\Ramen\Projects\slidev-test\slides.md

slide show      > http://localhost:3030/
presenter mode  > http://localhost:3030/presenter
remote control  > http://172.16.0.11:3030/presenter
remote control  > http://192.168.1.94:3030/presenter

I went on http://localhost:3030/ but it is all blank. Console side I got this error:

Failed to load resource: the server responded with a status of 404 (Not Found) on http://localhost:3030/@fsD:/Ramen/Projects/slidev-test/node_modules/@slidev/client/main.ts

Thanks again!

Same happening here #7

antfu commented 3 years ago

I end up installing a Windows VM to fix this 😅. Everything should be fine now with 0.1.5.

reazan commented 3 years ago

I end up installing a Windows VM to fix this 😅. Everything should be fine now with 0.1.5.

Tested version 0.1.5 and all works as expected. Thank you for go wild to fix it! (≧ω≦ )