Troubleshooting (React developers)¶
Common fixes for packaging, production builds, and LMS delivery. Start at the troubleshooting hub for a combined decision tree. Vibe-coding users: see vibe coding troubleshooting. General questions: FAQ.
Decision tree¶
If you see… |
Go to |
|---|---|
SCORM zip not where expected |
|
|
|
Blank page or throw after LMS upload |
|
|
|
xAPI/cmi5 packaging fails on activity IRI |
|
Analytics/xAPI 401, 403, or CORS errors |
|
|
|
LMS shows no completion/score |
|
|
|
Node engine / version errors |
Cannot find the SCORM zip¶
Symptom: You look for .lxpack/out/course-scorm12.zip at the project root and the file is missing.
Fix: See the canonical path in the FAQ — SCORM zip location. Trust the path lessonkit package prints on stdout. Details: LMS Go-Live — SCORM output layout.
lessonkit package fails on ID parity¶
Symptom: Errors about missing checkId, unknown courseId, or React/manifest mismatch.
Fix:
Every
checkIdin React must appear inlessonkit.json→course.assessments[].<Course courseId="…">must matchcourse.courseIdin the manifest.Use
"layout": "single-spa"for standard CLI packaging.
Production build or packaged course throws on load¶
Symptom: Blank page, VITE_ANALYTICS_URL is required, or assertProductionCourseConfig error in the browser console after npm run build, vite preview, or LMS launch.
Fix:
Production export: Copy
.env.exampleto.env, setVITE_ANALYTICS_URLandVITE_XAPI_PROXY_URL, rebuild, then package.First test export only: Temporarily set
tracking: { enabled: false }andxapi: { enabled: false }incourseConfig.ts.Dev vs prod:
npm run devuses console sinks; production mode enforces real delivery or explicit disable.
Details: LMS Go-Live · production checklist (appendix) · Backend proxy cookbook.
Observability hook errors¶
Symptom: assertProductionCourseConfig throws at startup with a message about missing onLxpackBridgeMiss, onTelemetrySinkError, onXapiTransportError, or similar.
Fix:
Open
src/courseConfig.tsand wire the observability hooks scaffolded there (uncomment and route to your monitoring stack).Match hooks to what you enable — see the observability table.
For a first smoke test only, disable delivery:
tracking: { enabled: false },xapi: { enabled: false }.Rebuild (
npm run build) before packaging.
HTTPS activity IRI required¶
Symptom: lessonkit package --target xapi or --target cmi5 fails validation on activityIri, or packaging warns that the IRI must be HTTPS.
Fix:
Edit
lessonkit.json→course.tracking.xapi.activityIri.Replace the
example.complaceholder fromlessonkit initwith a real HTTPS IRI (for examplehttps://lms.example.com/courses/my-course).Re-run
npm run package:xapiorpackage:cmi5.
See Manifest reference.
CORS and proxy errors¶
Symptom: Browser console shows CORS blocked requests, 401/403 from your analytics or xAPI proxy, or onXapiTransportError / onTelemetrySinkError firing after LMS launch.
Fix:
Confirm
.envhasVITE_ANALYTICS_URLandVITE_XAPI_PROXY_URLpointing at your backend proxies (not the LRS directly with embedded credentials).Configure your proxy to accept requests from the packaged course origin and return appropriate CORS headers.
Use short-lived tokens from your backend; never ship LRS Basic auth passwords in the client bundle.
Wire
onXapiTransportErrorandonTelemetrySinkErrorso failures surface in monitoring.
Details: Deployment guide · LRS operations
npm install failures¶
Symptom: npx @lessonkit/cli init fails during npm install, or you see EBADENGINE, peer dependency warnings, or registry timeout errors.
Fix:
Error |
Action |
|---|---|
|
Use Node.js 20.19+ for |
Registry timeout / |
Retry |
Peer dependency conflicts |
Align |
Non-empty directory |
Use |
Skip install during init |
|
See Prerequisites and CLI reference.
SCORM runs but LMS shows no completion or score¶
Symptom: Learner finishes the course in the LMS player; status stays incomplete.
Fix:
Set
lxpack: { bridge: "auto", allowedParentOrigins: ["https://your-lms.example"] }incourseConfig.tsbefore packaging (init template defaults to"off"). Production builds deny bridge forwarding whenallowedParentOriginsis empty.Verify the LMS parent exposes
window.parent.lxpackBridge.v1in SCORM preview.Discover the parent origin: inspect
document.referrer, the LMS launch URL, or the parent frame in browser devtools. Use the exact scheme, host, and port in the allowlist.Wire
onLxpackBridgeMissin production—see LXPack bridge reference.
Bridge works in dev but not after LMS upload¶
Symptom: npm run dev shows completions; packaged SCORM in the LMS does not.
Fix: Production requires allowedParentOrigins with bridge: "auto". Development skips the allowlist check. Rebuild after updating courseConfig.ts, then re-package.
Quiz does not mark complete¶
Confirm
checkIdon the assessment matcheslessonkit.json→course.assessments[].checkId.Confirm the learner selected the exact answer string from
choices.Ensure the assessment is inside
<Lesson>(required for telemetry in production).
Empty dist/ or packaging skips build¶
Symptom: Packaging fails because dist/ is missing.
Fix: Run npm run build or omit --no-build on lessonkit package.
Node version errors¶
Task |
Node.js |
|---|---|
|
18+ |
CLI scaffold (Vite 8), monorepo e2e |
20.19+ recommended |
node -v # expect v18.x, v20.x, or v22.x
lessonkit: command not found¶
npx @lessonkit/cli dev
# or: npm install -g @lessonkit/cli
Prefer npm run dev in scaffolded projects (uses the local CLI in node_modules).
Still stuck?¶
GitHub issues: eddiethedean/lessonkit