Hacker News new | ask | show | jobs
by tanepiper 2140 days ago
Same - I wonder if it's because it's some sandbox context and it's trying to bind to window (it's the UMD version)
1 comments

I've had a look and wasn't able to get it to work yet, imports can be bit iffy: usually anything that exposes ES modules or puts variables on the window object work fine.

It looks like the reason it doesn't work here is because it relies on "this" being the window object. To make top-level await possible your code gets wrapped into a function, and in there "this" no longer points to the window. I am sure a workaround is possible, I'll make a ticket on github.

https://github.com/gzuidhof/starboard-notebook/issues/1