Skip to content

Commit fb3e1b5

Browse files
authored
fix(runtime): make Engine.World awake errors escalate the stack as expected (#159)
1 parent 5825e47 commit fb3e1b5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/thin-actors-fold.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@jolly-pixel/runtime": patch
3+
---
4+
5+
Fix loadRuntime so error throw in world.connect() can escalate the stack

packages/runtime/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ export async function loadRuntime(
9595
await loadingCompletePromise;
9696
}
9797

98-
await loadingComponent.complete(() => {
99-
runtime.canvas.style.opacity = "1";
100-
runtime.start();
101-
});
98+
await loadingComponent.complete();
10299
}
103100
catch (error: any) {
104101
loadingComponent.error(error);
105102
}
103+
104+
runtime.canvas.style.opacity = "1";
105+
runtime.start();
106106
}
107107

108108
export { Runtime, type RuntimeOptions };

0 commit comments

Comments
 (0)