{"record":{"id":"b24564872b562439","repo":"clockworklabs/SpacetimeDB","slug":"it-seems-like-you-haven-t-exported-your-schema-yo","errorCode":null,"errorMessage":"It seems like you haven't exported your schema. You must `export default schema(...);`","messagePattern":"It seems like you haven't exported your schema\\. You must `export default schema\\(\\.\\.\\.\\);`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/tasks/javascript.rs","lineNumber":287,"sourceCode":"        Option::zip(maj.parse::<u16>().ok(), min.parse::<u16>().ok())\n    });\n\n    let mut maj_sys_ver = None;\n    for (maj, _min) in sys_imports {\n        anyhow::ensure!(\n            *maj_sys_ver.get_or_insert(maj) == maj,\n            \"The module pulls in 2 different versions of the `spacetimedb/server` package\"\n        );\n    }\n\n    let maj_sys_ver = maj_sys_ver.context(\n        \"Your module doesn't import the `spacetimedb/server` package at all - \\\n         this is likely a mistake, as your module will not be able to interface \\\n         with the SpacetimeDB host.\",\n    )?;\n\n    if maj_sys_ver == 2 {\n        anyhow::ensure!(\n            output_chunk.exports.contains(&\"default\".into()),\n            \"It seems like you haven't exported your schema. You must `export default schema(...);`\"\n        );\n    }\n\n    Ok(project_path.join(\"dist\").join(\"bundle.js\"))\n}\n","sourceCodeStart":269,"sourceCodeEnd":295,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/tasks/javascript.rs#L269-L295","documentation":"Error \"It seems like you haven't exported your schema. You must `export default schema(...);`\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/cli/src/tasks/javascript.rs:287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}