wasm-tool / parcel-plugin-wasm.rs

wasm-bindgen support for Parcel bundler
MIT License
66 stars 16 forks source link

Only one default export allowed per module. in 1.2.16 #33

Closed zoechi closed 4 years ago

zoechi commented 4 years ago

/home/user/source/yc/checkbox/node_modules/parcel-plugin-wasm.rs/wasm- loader.js:455:0: Only one default export allowed per module. (455:0)

The following code which causes the error is inserted twice into node_modules/parcel-plugin-wasm.rs/wasm- loader.js

export default function init(wasmUrl) {
  return load(wasmUrl, {
    ['./yc_checkbox_bg.js']: {
      __wbindgen_object_drop_ref,
      __wbindgen_cb_drop,
      __wbindgen_string_new,
      __wbindgen_object_clone_ref,
      __wbindgen_is_undefined,
      __wbg_instanceof_Window_f66ee047e567d37e,
      __wbg_document_6afeff73f2c4450f,
      __wbg_createElement_d6c085ee8bb866af,
      __wbg_createElementNS_0ac48b98fc2e938e,
      __wbg_createTextNode_fcf1027f673d8d1f,
      __wbg_querySelector_032fb8b5ce3b599f,
      __wbg_instanceof_HtmlTextAreaElement_6ce785194ded4842,
      __wbg_setvalue_bb2cc5bc65c14913,
      __wbg_instanceof_HtmlInputElement_29632bf7627ad3b9,
      __wbg_setchecked_83595cadbbe0d9e4,
      __wbg_settype_0e7c0c3f9941aeb0,
      __wbg_setvalue_420fac6ba021e7fc,
      __wbg_removeEventListener_be7b31e4a70578cf,
      __wbg_lastChild_7affb7a585ea8069,
      __wbg_nextSibling_a9ccd318b39e88e9,
      __wbg_setnodeValue_4a66735d59ec9cc8,
      __wbg_appendChild_bbc0804c00934eff,
      __wbg_insertBefore_25550fdfe01c7a08,
      __wbg_removeChild_68c3193d06f5b03d,
      __wbg_namespaceURI_11f38935903d44a0,
      __wbg_removeAttribute_e2ffee615fe558e0,
      __wbg_setAttribute_cb065ec2a4c8ec2c,
      __wbg_debug_638f72a166bd0e27,
      __wbg_error_f6e7c99a067a129b,
      __wbg_error_83df4d37c4ea8d49,
      __wbg_info_b0a730d92ab42e2c,
      __wbg_log_404ff8023b1a5a6d,
      __wbg_warn_31a149ac6561006b,
      __wbg_call_ae0789b871c5d57f,
      __wbg_newnoargs_e710e627874fc912,
      __wbg_self_0f608b57f60a1319,
      __wbg_window_b7fda4753d5a6f96,
      __wbg_globalThis_f2ab166b2dad2691,
      __wbg_global_5a16f080534aa1b3,
      __wbindgen_debug_string,
      __wbindgen_throw
    }
  }).then(wasmExports => {
    wasm = wasmExports;
    return {
      run
    }
  });
}

I also found it a bit weird that a file is created inside node_modules but I do not have much knowledge about these wasm tools.

Previously I run into https://github.com/rustwasm/rust-parcel-template/issues/45, but now 1.2.15 is working fine. Not sure if this is relevant.

zoechi commented 4 years ago

I can not reproduce today anymore. In case I run into this again, I'll reopen.