docs(quickstarts): fix first-run failures on the python, react, cli, and node pages#391
Merged
Conversation
This was referenced Jul 20, 2026
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.

Type: fix. One PR, four quickstart pages, seven files. Each change closes a reproducible first-run failure found by walking all nine quickstarts end to end in clean sandboxes and re-verifying every finding in a second pass. This started as four single-page PRs; #392, #393, and #394 are folded into this one, which began as the python PR. Combined so the review is one sitting instead of four.
These pages were created in the #354 docs refactor merged July 16 and had not been walked end to end yet. The docs bots do mechanical sync and grammar passes (open PR #390 is a grammar-only edit that also touches one of these pages), so first-run defects survive them.
Python quickstart (
docs/en-US/python/quickstart.mdx)gt-i18n,gt-flask, andgt-fastapi"are all at version 0.3.0". PyPI's latest for all three is 0.1.0; 0.3.0 was never published. Dropped the hardcoded number rather than pin a new one, kept what the callout is for: experimental SDK, Python 3.10+.gt translate, butgtis the Node CLI and the page only ever runspip install. Following the page as written givescommand not found: gt. Fixed tonpx gt translatewith a note linking the CLI quickstart.appbut the page never starts the server. Added run commands inside each tab:flask --app app run, anduvicorn main:appwith thepip install "uvicorn[standard]"line it needs (gt-fastapi does not pull in an ASGI server).React quickstarts (4 pages): missing
_gtfiles break the first runloadTranslationsimports_gt/${locale}.jsonbefore anything on the page has created those files;npx gt generateis only mentioned later, inside a collapsed accordion. Symptom verified per page, twice, in clean sandboxes:npm run devreturns HTTP 500. Empty{}stubs flip it to 200 with no other change.The change is one callout per page at the point the failing code is introduced, stating that the files do not exist yet, how to create them, and the exact symptom for that page. Three pages get a Warning; the Pages Router page gets a Note because nothing breaks there. Pure insertions, no steps reordered.
CLI quickstart: non-interactive setup for CI (
docs/en-US/cli/quickstart.mdx)Step 4 tells readers to run
gt translatein their CI pipeline, but the setup step cannot run in CI:gt initonly prompts, andnpx gt init < /dev/nullexits 0 without writinggt.config.jsonor credentials, so a CI script sees a false success. Added a warning callout at step 2, a "Non-interactive setup for CI" section (minimal hand-writtengt.config.json, theGT_API_KEYandGT_PROJECT_IDenv vars,npx gt translate --config gt.config.json), and fixed the step 3 code block title from.envto.env.local, which is what the wizard writes. Every flag, filename, and config field checked against the CLI source inpackages/cli.Node quickstart: not completable as written (
docs/en-US/node/quickstart.mdx)npm init -ywrites"type": "commonjs", so the page's first ESM sample fails withSyntaxError: Cannot use import statement outside a module. Beyond that:expressis imported but never installed, no block callsapp.listenand no step runs the server, andnpx gt translatedead-ends without the config or credentials the page never creates. Added the"type": "module"note in step 1,expressin all four package-manager tabs,app.listenplus a "Run and verify" step (node server.js, acurl, and the expected response), a one-line note to runnpx gt initbefore the translate step, and fixed code fences taggedtson plain-JS blocks. Verified by scaffolding the page from scratch and curling the running server: HTTP 200 with{"message":"Hello, Alice!"}.Verification
Run on the combined branch:
validate:unsafe-html(418 MDX files) pass,validate-linkspass,pnpm build:contentpass (434 pages, all four quickstarts render). The four commits are the original reviewed commits, one per source PR, cherry-picked unchanged; the file sets are disjoint. All four react files merge-checked against the open bot PRs touching them (#381, #383, #390, #372).Coordination with #389
Draft #389 rewrites the Node page's step 2 (credentials), blocked on a gt-node release. This PR leaves step 2 untouched, including its one
tsfence, since #389 is actively rewriting that block. Merge-order note: the new "Run and verify" step expects a source-string echo, which is correct on current main; when #389 lands its real dev key, that expected output needs a one-line follow-up in either merge order.If any of this was deliberate
Each section keeps its escape hatch. Python: if the packages are versioned on a private index where 0.3.0 is real, I will reword the callout to point there instead. React: if the intent is that readers reach generate before running, I can rescope to reordering steps instead of callouts. CLI: if CI setup belongs in the Configuring guide, I can move the section there and leave a callout and link. Node: if the page assumes an existing Express app, I can rescope to state that assumption up front. Say the word on any of them.