Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 3eadae1

Browse files
committed
Fix nodecg instance serialization errors
1 parent 67089a6 commit 3eadae1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

nodecg-io-core/dashboard/panel.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@
105105
window.setServiceDependency = setServiceDependency;
106106

107107
// Add key listener to password input
108-
document.getElementById("inputPassword").addEventListener("keyup", function(event) {
108+
document.getElementById("inputPassword").addEventListener("keyup", function (event) {
109109
if (event.keyCode === 13) {
110110
event.preventDefault();
111-
window.loadFramework()
111+
window.loadFramework();
112112
}
113-
})
113+
});
114114
</script>
115115
</body>
116116
</html>

nodecg-io-core/extension/serviceBundle.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ export abstract class ServiceBundle<R, C> implements Service<R, C> {
4444
if (this.core === undefined) {
4545
return undefined;
4646
} else {
47+
// Hide nodecg variable from serialization.
48+
// The service is saved in a Replicant and nodecg tries to serialize everything in there, including
49+
// nodecg instances, which throw errors when serialized.
50+
Object.defineProperty(this, "nodecg", { enumerable: false });
4751
return this.core.registerService(this);
4852
}
4953
}

0 commit comments

Comments
 (0)