I guess this is the right forum for this question....
# javascript
t
I guess this is the right forum for this question. I have builded a webpage by following this: https://play.kotlinlang.org/hands-on/Building%20Web%20Applications%20with%20React%20and%20Kotlin%20JS/01_Introduction But am getting this error in browser console:
Copy code
Uncaught 
Object { "message_8yp7un$_0": undefined, "cause_th0jdv$_0": null, stack: "i/</e.captureStack@http://localhost:9000/static/output.js:3:209256\n$n@http://localhost:9000/static/output.js:3:54266\ngn@http://localhost:9000/static/output.js:3:54329\nbn@http://localhost:9000/static/output.js:3:54433\nPn@http://localhost:9000/static/output.js:3:55118\ni/</e.throwNPE@http://localhost:9000/static/output.js:3:213780\ni/t.ensureNotNull@http://localhost:9000/static/output.js:3:15312\ni/le.prototype.addRestaurantPage/<@http://localhost:9000/static/output.js:30:8941\nC@http://localhost:9000/static/output.js:10:610418\nH.render_2955dm$@http://localhost:9000/static/output.js:10:911384\ni/le.prototype.addRestaurantPage@http://localhost:9000/static/output.js:30:8899\nve@http://localhost:9000/static/output.js:30:9565\ni@http://localhost:9000/static/output.js:30:134260\n@http://localhost:9000/static/output.js:30:134271\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:30:1183\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:1:1139\n@http://localhost:9000/static/output.js:1:1150\n@http://localhost:9000/static/output.js:1:203\n@http://localhost:9000/static/output.js:1:207\n", name: "NullPointerException" }

"cause_th0jdv$_0": null

"message_8yp7un$_0": undefined

name: "NullPointerException"

stack: "i/</e.captureStack@http://localhost:9000/static/output.js:3:209256\n$n@http://localhost:9000/static/output.js:3:54266\ngn@http://localhost:9000/static/output.js:3:54329\nbn@http://localhost:9000/static/output.js:3:54433\nPn@http://localhost:9000/static/output.js:3:55118\ni/</e.throwNPE@http://localhost:9000/static/output.js:3:213780\ni/t.ensureNotNull@http://localhost:9000/static/output.js:3:15312\ni/le.prototype.addRestaurantPage/<@http://localhost:9000/static/output.js:30:8941\nC@http://localhost:9000/static/output.js:10:610418\nH.render_2955dm$@http://localhost:9000/static/output.js:10:911384\ni/le.prototype.addRestaurantPage@http://localhost:9000/static/output.js:30:8899\nve@http://localhost:9000/static/output.js:30:9565\ni@http://localhost:9000/static/output.js:30:134260\n@http://localhost:9000/static/output.js:30:134271\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:30:1183\nn@http://localhost:9000/static/output.js:1:340\n@http://localhost:9000/static/output.js:1:1139\n@http://localhost:9000/static/output.js:1:1150\n@http://localhost:9000/static/output.js:1:203\n@http://localhost:9000/static/output.js:1:207\n"

<prototype>: Object { constructor: Pn(t), stack: "" }
How to map this error to the Kotlin code? Earlier if I used to caught these errors, I was able to fix it on spot somehow relating it to kotlin code am writing. But not now because I have written lots of code and suddenly this error is coming in browser console am clueless on how to debug this. can you please point me to the right direction?
@turansky this is what I was requesting help for few weeks back when you asked for a code snippet. Now code base is big not sure how to share the codebase but is it possible to map these console errors to kotlin code somehow? On JVM code I can attach a debugger but not here for obvious reasons.
a
Looks like it is a bad
external
declaration. Something from external is return undefined
t
I fixed this issue by going through my commits, I was accessing a null pointer. But thing is that with the js stack trace it is not possible to see what went wrong in the kotlin code.
a
yeah, js stack trace is currently not very helpful
1