O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Examining panic stack traces

For runtime errors that cannot be found by the transpiler at transpile time, there usually is a helpful panic stack trace, which is displayed in the web browser's console, and provides us with valuable information to diagnose issues. The JavaScript source map file that GopherJS produces helps the web browser map the JavaScript instructions to their respective lines in the Go source files.

Let's introduce a runtime error whereby our client-side program is syntactically correct (it will pass the transpiler checks); however, the code will issue a problem at runtime.

Going back to the run function found in the client/client.go source file, notice the following code changes we've made with regards to the ts variable: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required