Skip to content

fix(cli): don't crash when the public IP can't be resolved - #2726

Open
lazerg wants to merge 2 commits into
slidevjs:mainfrom
lazerg:fix/issue-2724
Open

fix(cli): don't crash when the public IP can't be resolved#2726
lazerg wants to merge 2 commits into
slidevjs:mainfrom
lazerg:fix/issue-2724

Conversation

@lazerg

@lazerg lazerg commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

On a network where the public IP can't be resolved (blocked DNS, for example), slidev --remote=<password> dies before printing anything. publicIpv4() rejects there, and neither call site guards it: the dev server one takes down the process with DOMException [TimeoutError], and the c (qrcode) shortcut leaves an unhandled rejection.

The public IP only adds one extra "remote control" URL, so both calls now go through a small helper that catches the failure and warns, the same way the failed-to-open-browser path does. printInfo already treats the IP as optional and still prints the LAN URLs.

There's no test harness for cli.ts here, so I checked it by hand against the starter demo with public-ip stubbed to reject with the same TimeoutError. On main it crashes at startup; on this branch it warns, serves the deck, and still renders the QR code. With the stub removed the public IP shows up as before.

Fixes #2724

@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 6bd3463
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6a8effa73666520008bce074
😎 Deploy Preview https://deploy-preview-2726--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/@slidev/client@2726

create-slidev

npm i https://pkg.pr.new/create-slidev@2726

create-slidev-theme

npm i https://pkg.pr.new/create-slidev-theme@2726

@slidev/parser

npm i https://pkg.pr.new/@slidev/parser@2726

@slidev/cli

npm i https://pkg.pr.new/@slidev/cli@2726

@slidev/types

npm i https://pkg.pr.new/@slidev/types@2726

commit: 8607338

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

Successfully merging this pull request may close these issues.

Add error handling for calls to publicIpv4 to prevent crashing on --remote=<password> if public IP cannot be determined.

1 participant