r-wasm / webr

The statistical language R compiled to WebAssembly via Emscripten, for use in web browsers and Node.
https://docs.r-wasm.org/webr/latest/
Other
804 stars 54 forks source link

require is not defined #430

Closed 027xiguapi closed 2 weeks ago

027xiguapi commented 1 month ago

1717139047474 Chromium94.0.4606.71

open https://webr.r-wasm.org/latest/

027xiguapi commented 2 weeks ago

I found the reason, globalThis.document is undefined image

027xiguapi commented 2 weeks ago

WebAssembly.Tag is undefined

027xiguapi commented 2 weeks ago

image

georgestagg commented 2 weeks ago

Thank you for taking the time to debug this.

Unfortunately, WebAssembly.Tag is used for WebAssembly exceptions. WebR is built to use Wasm exceptions, and so this feature is absolutely required for the latest version of webR to function.

You might be able to use very old builds of webR, from before we used Wasm exceptions (e.g. https://webr.r-wasm.org/v0.1.0/), but I cannot say for sure.

It looks like Chromium 94.0.4606.71 was released in September 2021, which is quite old in terms of browser updates. The latest release is 128.0.6546.0. If you can upgrade to a newer version of Chromium, it should run webR better.

We don't plan to support such older browsers going forward, and so I'm going to close this issue as not planned.