Skip to content

Commit

Permalink
Don't crash dev server when a schema loading error occurs (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh authored Nov 13, 2024
1 parent 7287f24 commit 70dab29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cyan-steaks-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"houdini": patch
---

Don't crash dev server when a schema loading error occurs
6 changes: 5 additions & 1 deletion packages/houdini/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,11 @@ export async function getConfig({

// the schema is safe to load
if (schemaOk && !noSchema) {
_config.schema = await loadSchemaFile(_config.schemaPath)
try {
_config.schema = await loadSchemaFile(_config.schemaPath)
} catch (e) {
console.error(`⚠️ Your schema file could not be loaded: ${e}`)
}
}
}

Expand Down

0 comments on commit 70dab29

Please sign in to comment.