Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web example crashes when using clipboard in wasm #2321

Open
kahnclusions opened this issue Jan 4, 2023 · 0 comments
Open

Web example crashes when using clipboard in wasm #2321

kahnclusions opened this issue Jan 4, 2023 · 0 comments
Labels
bug does not behave the way it is supposed to help wanted has no one working on it yet shell/web concerns the web backend

Comments

@kahnclusions
Copy link

It looks like Druid tries to call Application::global() when doing stuff with the clipboard but this panics, maybe because the global app is stored in a thread_local! variable which doesn't work in wasm.

Steps to reproduce

  1. Clone the repo and then run:
❯ wasm-pack build --target web --dev
❯ http
  1. Open browser and navigate to http://localhost:8000/
  2. Try to cut/copy/paste any text in the textbox
  3. See the following error in the JS console:
hello_web.js:333 panicked at 'There is no globally active Application', /.../druid/druid-shell/src/application.rs:109:35

Stack:

Error
    at http://localhost:8000/pkg/hello_web.js:339:21
    at logError (http://localhost:8000/pkg/hello_web.js:233:18)
    at imports.wbg.__wbg_new_abda76e883ba8a5f (http://localhost:8000/pkg/hello_web.js:338:66)
    at console_error_panic_hook::Error::new::h196751a1eab8f86e (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[8917]:0x31a10f)
    at console_error_panic_hook::hook_impl::h0db4adfa38059141 (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[1669]:0x201334)
    at console_error_panic_hook::hook::hd8a36f6179709228 (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[9547]:0x322b08)
    at core::ops::function::Fn::call::hf4cc558cb113cf3a (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[8654]:0x315f70)
    at std::panicking::rust_panic_with_hook::he04cb00575f2a1e3 (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[3489]:0x280df4)
    at std::panicking::begin_panic_handler::{{closure}}::hb733f0aa505760cf (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[4587]:0x2b35fc)
    at std::sys_common::backtrace::__rust_end_short_backtrace::h6beefa0bcab220bc (http://localhost:8000/pkg/hello_web_bg.wasm:wasm-function[10070]:0x3295f0)
@xStrom xStrom added bug does not behave the way it is supposed to help wanted has no one working on it yet shell/web concerns the web backend labels Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug does not behave the way it is supposed to help wanted has no one working on it yet shell/web concerns the web backend
Projects
None yet
Development

No branches or pull requests

2 participants