Repository navigation
[crash] Can't find variable: onDestroy #78
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The app hit an unexpected error and showed the recovery screen.
Error details
AiSettingsDialog@http://localhost:1420/src/lib/components/AiSettingsDialog.svelte:451:11
@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:698:71
update_reaction@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4885:18
update_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4985:33
create_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4310:17
@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:695:19
update_reaction@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4885:18
update_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4985:33
create_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4310:17
block@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4500:28
wrapper@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:689:8
add_svelte_meta@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:978:18
StudioShell@http://localhost:1420/src/lib/components/StudioShell.svelte:7796:19
@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:698:71
update_reaction@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4885:18
update_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4985:33
create_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4310:17
@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:695:19
update_reaction@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4885:18
update_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4985:33
create_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4310:17
block@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4500:28
wrapper@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:689:8
add_svelte_meta@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:978:18
@http://localhost:1420/src/App.svelte:148:25
snippet@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:233:13
update_reaction@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4885:18
update_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4985:33
create_effect@http://localhost:1420/node_modules/.vite/deps/runtime-DY7OeTBY.js:4310:17
ensure@http://localhost:1420/node_modules/.vite/deps/client-B1YgD9dQ.js:187:40
@http://l
Steps to reproduce
Expected behavior
App version: 1.20.0
Platform: macOS
Reported via: in-app
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
fix(ai-settings): import onDestroy (#78)
broisnischal commentedon Aug 8, 2026
Fixed in
fe6820e2on #75.I introduced this in the previous commit — an
onDestroyhandler whose import never landed. Opening AI settings then took the whole app down.Worth recording why it shipped: nothing in the toolchain catches it. Svelte compiles an unimported lifecycle call as a free variable and emits it verbatim,
vite buildsucceeds, andsvelte-checkreports zero errors — I verified that against a probe file, because these script blocks are plain JS with nocheckJs. It only fails on mount.So alongside the fix there's now a test that scans every
.sveltefile for calls to Svelte's runtime API (onMount,onDestroy,tick,untrack,getContext,mount/unmount, …) that the file never imports. Confirmed by removing the import again — the suite names the file and the symbol.