Lab GuideTroubleshooting
14:30 17:00

LAB GUIDE / APPENDIX

Troubleshooting

Accounts#

ProblemFix
Cloudflare signup shows a challenge or errorWait a minute and retry. Many signups from the same network can trigger extra checks. Tell the teacher if it persists
"Verify your email" / deploy failsClick the link in Cloudflare's verification email, then retry

Terminal#

ProblemFix
node: command not found (after installing)Close and reopen the terminal
npx wrangler login doesn't open a browserCopy the URL it prints into your browser
git push asks for a passwordRun gh auth login (HTTPS → web browser). GitHub doesn't accept account passwords for git
git push rejected (fetch first)git pull --rebase then git push
wrangler dev asks which account, or fails with an account errorYou have several Cloudflare accounts. The AI binding runs remotely in dev, so Wrangler needs to know which one. Set CLOUDFLARE_ACCOUNT_ID to the account you created today (find it in the dashboard sidebar), for example CLOUDFLARE_ACCOUNT_ID=<id> npm run dev on macOS/Linux, or $env:CLOUDFLARE_ACCOUNT_ID="<id>"; npm run dev in PowerShell
Port 8787 in usenpx wrangler dev --port 8788
Windows curl behaves strangelyUse curl.exe or the PowerShell snippet in section 7

Deploys (Workers Builds)#

ProblemFix
Pushed but nothing changedDashboard → your Worker → Deployments: is the build still running? Did it fail? Open the build log
Build failed: name mismatchDon't change "name" in wrangler.jsonc. It must match the Worker name in the dashboard
Changed a var in the dashboard and it was resetExpected. vars come from wrangler.jsonc on every deploy

Runtime#

ProblemFix
The ID card says "Character: unknown" and your code looks rightSWAPI is down, so getCharacter returned the placeholder. It tries swapi.dev, then swapi.info. Run npx wrangler tail and look for "SWAPI request failed". Wait a minute and reload. Cached answers (cacheTtl) keep working
CHARACTER_ID is 17 (or above 83) and the card stays "unknown"That Character doesn't exist. Pick a number from 1 to 83, except 17
Your Droid says it is "Unknown Droid"Same cause as the line above: getCharacter returned the placeholder. Check npx wrangler tail
Error: Worker exceeded CPU time limitSomething heavy is running per request. Ask the teacher; the template is designed to stay well under the limit
Anything elsenpx wrangler tail, then read the error. It's almost always telling you exactly what's wrong

Your project

Pick your Droid Name first. Add the rest when you know it; every field is optional. These details stay in this browser and are never sent anywhere.

A nickname, not your full name. Used for your Student Worker and repo. Lowercase letters, numbers and hyphens; up to 40 characters.

The workers.dev subdomain you choose at signup. Same naming rules as your Droid Name.

Add this later, or paste a GitHub repo URL to fill your username and Droid Name.

My URL is different

Optional. Use your public https://…workers.dev URL. Paths and trailing slashes are removed. Leave blank to use your Droid Name and subdomain.

LIVE PREVIEW

Your droid will live at https://<your-droid-name>.<your-subdomain>.workers.dev

Your repo: github.com/<your-github-user>/<your-droid-name>