fix(error-tracking): hand off a missing .env loader instead of wiring one - #408
Merged
Merged
Conversation
init.md offered `--env-file=.env` on the `start` script as an equal option to dotenv. `.env` is gitignored, so it is usually missing where the app is deployed, and `node --env-file=.env` exits 9 before any app code runs when it is. init.md and configure.md now prefer dotenv, allow `--env-file-if-exists=.env` only on Node 22.9+, and never put a hard `--env-file=.env` on `start`. report.md also said "every production build now uploads" whenever the build was wired, even when the credentials or wire-ci handoff was skipped. It now has a third branch for that case. A contract test pins all three rules. Closes PostHog/wizard#1329 Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a wizard branch:
Add Results will be posted here when complete. |
… one Every way to wire a loader into a plain Node app guesses where it runs: a hard --env-file stops the app where .env is missing, --env-file-if-exists needs Node 22.9, and inlining the variables commits the key. init.md and configure.md now leave the scripts alone and name the gap in the handoff as a manual follow-up. report.md opens with a `>⚠️ **Needs your attention**` block listing every follow-up. The wizard reads that block back on exit. Closes PostHog/wizard#1329 Generated-By: PostHog Desktop Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
gewenyu99
marked this pull request as ready for review
September 24, 2026 16:00
ablaszkiewicz
approved these changes
Sep 24, 2026
ablaszkiewicz
left a comment
Contributor
There was a problem hiding this comment.
🚀 (not sure if we really need this test but I'm ok with it)
Collaborator
Author
|
tested, seems to work alright |
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.
The error-tracking flow stops editing a Node app's
startanddevscripts to load.env. When nothing loads it, the agent names the gap in its handoff, and the report opens with a> ⚠️ **Needs your attention**block listing every follow-up.Closes PostHog/wizard#1329
What broke
init.mdoffered--env-file=.envonstartas an equal choice todotenv..envis gitignored, so it's missing where the app is deployed, and Node exits at boot (node: .env: not found, exit 9). The report also promised "every production build now uploads" when the credentials or CI step was skipped.What's new
init.md,configure.md. No loader wiring. A missing loader becomes a manual follow-up.report.md. Opens with the warning block. No upload promise while credentials or CI are pending.error-tracking-env-loading.test.js. Pins these rules.Verification
pnpm test: 27 files, 214 tests.wizard error-tracking --cirun onexpress-todoagainst this branch: nodotenv, no--env-file, and the report opened with the block, including "this plain Node app does not automatically load.env".Created with PostHog Desktop