学会 React 之后卡在部署
跟着模型学 React,开发正常,但 Vercel 因缺少环境变量失败了 6 次。
I used AI to learn React because I wanted to get past the blank-page stage fast. The components made sense in dev, state updates worked, and I could build a small dashboard without copying everything line by line. That part felt surprisingly smooth.
Then I tried to deploy to Vercel. It failed 6 times because I followed a stale setup the model had given me and missed one env variable. Locally everything worked, so I kept assuming the bug was in the build cache or some weird React version issue.
What burned time was not the app code but the deployment details: build commands, environment variables, and the difference between local `.env` files and platform settings. I kept re-running the same deploy, which was dumb, but the errors were vague enough to make that seem plausible.
After I finally found the missing variable, I realized I still don't know how to tell a fresh setup from an outdated one when the model sounds confident. Next time I'd check the platform docs first and treat the generated setup as a draft, not the source of truth.
5 replies
Was the missing env variable used at build time or runtime?
Build time. That was the annoying part, because local dev never exposed it.
Been there. I learned React faster than I learned deployment, which feels backwards.
If Vercel fails repeatedly, compare the env list in dashboard vs local `.env` first. That catches a lot.
This is why I don't trust generated setup steps without checking the platform docs.