fix: Replace dns.lookup with https.get for create-turbo online check#12277
Merged
anthonyshew merged 1 commit intomainfrom Mar 13, 2026
Merged
fix: Replace dns.lookup with https.get for create-turbo online check#12277anthonyshew merged 1 commit intomainfrom
anthonyshew merged 1 commit intomainfrom
Conversation
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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #12250
dns.lookup()withhttps.get()for the connectivity check increate-turboWhy
The previous code manually reimplemented proxy detection (
getProxy()checking env vars +npm config) that theProxyAgent— already configured ashttps.globalAgentincli.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-turbousing 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)