Skip to content

fix: Replace dns.lookup with https.get for create-turbo online check#12277

Merged
anthonyshew merged 1 commit intomainfrom
shew/investigate-12250
Mar 13, 2026
Merged

fix: Replace dns.lookup with https.get for create-turbo online check#12277
anthonyshew merged 1 commit intomainfrom
shew/investigate-12250

Conversation

@anthonyshew
Copy link
Copy Markdown
Contributor

@anthonyshew anthonyshew commented Mar 13, 2026

Summary

Closes #12250

  • Replace dns.lookup() with https.get() for the connectivity check in create-turbo

Why

The previous code manually reimplemented proxy detection (getProxy() checking env vars + npm config) that the ProxyAgentalready configured as https.globalAgent in cli.ts — handles automatically (env vars, npm config, PAC files, SOCKS, system settings).

https.get() goes through the global agent, so all proxy scenarios are covered without manual detection. It also tests actual HTTP connectivity rather than just DNS resolution, which is what actually matters.

Testing

Ask the reporter to test with bunx create-turbo using this branch. Alternatively, confirm the change works by running:

  • npx create-turbo (should work as before)
  • bunx create-turbo (should no longer false-positive as offline)

The dns.lookup-based connectivity check fails under Bun's runtime
because Bun's polyfill of node:dns behaves differently from Node's
libuv-backed implementation, causing the 5s timeout to fire before
DNS resolves. This also manually reimplemented proxy detection that
the ProxyAgent (already set as https.globalAgent in cli.ts) handles.

Replace with an https.get call that tests actual HTTP connectivity
and automatically goes through the configured ProxyAgent.
@anthonyshew anthonyshew requested a review from a team as a code owner March 13, 2026 12:10
@anthonyshew anthonyshew requested review from tknickman and removed request for a team March 13, 2026 12:10
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
examples-vite-web Building Building Preview, Open in v0 Mar 13, 2026 0:11am
turbo-site Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am
turborepo-agents Ready Ready Preview, Comment, Open in v0 Mar 13, 2026 0:11am

@turbo-orchestrator turbo-orchestrator Bot added the pkg: create-turbo Issues related to npx create-turbo label Mar 13, 2026
@anthonyshew anthonyshew enabled auto-merge (squash) March 13, 2026 12:12
@anthonyshew anthonyshew merged commit 9b69f8c into main Mar 13, 2026
48 checks passed
@anthonyshew anthonyshew deleted the shew/investigate-12250 branch March 13, 2026 12:18
github-actions Bot added a commit that referenced this pull request Mar 13, 2026
## Release v2.8.17-canary.14

Versioned docs: https://v2-8-17-canary-14.turborepo.dev

### Changes

- release(turborepo): 2.8.17-canary.13 (#12276) (`5677b17`)
- fix: Replace dns.lookup with https.get for create-turbo online check
(#12277) (`9b69f8c`)

Co-authored-by: Turbobot <turbobot@vercel.com>
anthonyshew added a commit that referenced this pull request Mar 13, 2026
## Summary

Closes #12250

- Remove the `isOnline()` preflight connectivity check from
`create-turbo`
- Remove the `proxy-agent` dependency (only used by the removed check)

## Why

The `isOnline` check was [introduced in
#11297](#11297) with a 5-second
timeout. For users with slow routes to `github.com` (but otherwise
working internet), this causes a false "You appear to be offline" error
that blocks `create-turbo` entirely.

Two prior fixes
([#12257](#12257),
[#12277](#12277)) changed the
check target and method but kept the 5s timeout. The [reporter still
fails with
canary.14](#12250 (comment))
across all package managers.

The check is redundant. `createProject` already handles offline failures
through `retry({ retries: 3 })` and throws `DownloadError`, which
`handleErrors` catches with a clear message ("Unable to download
template from GitHub" + the specific error). There's no need for a
separate preflight gate.

## Testing

All existing `create-turbo` tests pass. The "throws correct error
message when a download error is encountered" test verifies the
`DownloadError` path works correctly without the preflight check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: create-turbo Issues related to npx create-turbo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create-turbo network issues after 2.4.0

1 participant