blue
blue•2mo ago

error: Uncaught TypeError: Cannot set properties of undefined (setting 'target')

Hey, I get this whilst starting my app with Deno:
error: Uncaught TypeError: Cannot set properties of undefined (setting 'target')
at setTarget (ext:deno_web/02_event.js:97:29)
at dispatchEvent (ext:deno_web/02_event.js:1055:7)
at dispatchBeforeUnloadEvent (ext:runtime_main/js/99_main.js:466:22)
error: Uncaught TypeError: Cannot set properties of undefined (setting 'target')
at setTarget (ext:deno_web/02_event.js:97:29)
at dispatchEvent (ext:deno_web/02_event.js:1055:7)
at dispatchBeforeUnloadEvent (ext:runtime_main/js/99_main.js:466:22)
What would be the best way to go about debugging it?
6 Replies
Leokuma
Leokuma•2mo ago
One way is running your app with deno run --inspect-wait, attaching chrome debugger to it and advancing step by step. You can also set a breakpoint right before the part you suspect is malfunctioning My answer was maybe too brief. Let us know if you need more instructions or alternatives
blue
blueOP•2mo ago
Hey, thank you for your answer. Unfortunately, when I run the debugger, it works perfectly. It only fails when I don't. Do you see the error on your end? Reproduction -> git clone https://github.com/primate-run/apps && cd apps/apps/angular && deno install && deno run -A npm:primate test I think it's related to something in Angular, but I'm not sure how to go about debugging it. The other apps pass the tests successfully, and the Angular app passes in Node and Bun, so it might be some combination of Deno and Angular.
Leokuma
Leokuma•2mo ago
Yes I get the same error here on Linux. I don't know how to fix it 😔. I don't use Deno for frontend dev
blue
blueOP•2mo ago
Thanks for looking!
marvinh.
marvinh.•2mo ago
The best course of action to get this resolved is to file an issue here https://github.com/denoland/deno/issues

Did you find this page helpful?