You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When changing an input in a bound variable of a story which is available under "Controls" UI, I get the following error in the console:
Uncaught (in promise) TypeError: n is null.
I figured out that in util.js there is a check for an object, and an access to $$.
If the value is null the typeof object test succeeds (since null is type of object) and access to $$ is tried, in which case the execution of the code halts on the aforementionent error, which freezes histoire any updates on inputs in the control panel.
I am providing a fix in a PR.
The solution would be to change the access to $$ like this:
old
if (typeof value === 'object' && value.$$) continue
new
if (typeof value === 'object' && value?.$$) continue
Reproduction
<script> /** * @type {{ Story: any; Variant: any; Text: any; }} */
export let Hst
let text = 'tag: text'
</script><Hst.Storytitle="todo.svelte"layout={{type: 'grid',width: 500}}><Hst.Variant><div>{text}</div><svelte:fragmentslot="controls"><Hst.Textbind:value={text}title="text"/></svelte:fragment></Hst.Variant></Hst.Story>
Describe the bug
When changing an input in a bound variable of a story which is available under "Controls" UI, I get the following error in the console:
Uncaught (in promise) TypeError: n is null
.I figured out that in util.js there is a check for an object, and an access to $$.
If the value is
null
the typeof object test succeeds (since null is type of object) and access to $$ is tried, in which case the execution of the code halts on the aforementionent error, which freezes histoire any updates on inputs in the control panel.I am providing a fix in a PR.
The solution would be to change the access to $$ like this:
old
new
Reproduction
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: