WebDialog / HtmlDialog Tutorial using sketchup-bridge

I love the concept of this Sketchup Bridge. It would probably make UI design a lot easier. However, when trying out both the sample extention and the tutorial, I ran into an issue.

For example with the sample extension, simply starting it results in an error message:

Uncaught promise rejection with reason [NoMethodError]: "undefined method `call' for nil:NilClass"
Error: #<NoMethodError: undefined method `[]' for nil:NilClass>
C:/Users/ ... /sample_extension/bridge.rb:307:in `unhandled_rejection'
C:/Users/ ... /sample_extension/bridge.rb:252:in `reject'
C:/Users/ ... /sample_extension/bridge.rb:291:in `call'
C:/Users/ .. /sample_extension/bridge.rb:291:in `rescue in block in handle'
C:/Users/ .. /sample_extension/bridge.rb:282:in `block in handle'

I feel lik I might be missing something really obvious, but cannot (yet) figure out what it is.

I’m running this on Sketchup Pro 2020 20.1.235 on Windows

The tutorial results in the same error message whenever I use on of the buttons on the form.

There is an issue in SU2020 with the JSON lib version.
I made a pull request to fix it, you can try my fork: Fix JSON lib version check by jiminy-billy-bob · Pull Request #13 · Aerilius/sketchup-bridge · GitHub

2 Likes

Thanks for the fix, I merged it!

3 Likes

This works great, thanks! Also thanks to Aerilius for merging the fix. Now I can dive into sketchup-bridge.

I agree, thanks a lot Aerilius for this library!
We have started using it in our projects. Being able to use promises simplifies a lot of things!

1 Like