holochain / tryorama

Toolset to manage Holochain conductors and facilitate test scenarios
212 stars 14 forks source link

incomprehensible error.. wbindgen #191

Open nphias opened 10 months ago

nphias commented 10 months ago

i assume this means some problem with the wasm build.. but better error handling and info is needed

mac os ventura "dependencies": { "@msgpack/msgpack": "^2.7.0", "@holochain/client": "^0.16.2", "@holochain/tryorama": "^0.15.1", "js-base64": "3.7.5", "typescript": "^4.9.4", "vitest": "^0.28.4" },

stderr | .test.ts > create and read zome error occurred during test run: internal_error: Conductor returned an error while using a ConductorApi: RibosomeError(WasmRuntimeError(RuntimeError { source: User(WasmError { file: "crates/holochain/src/core/ribosome/real_ribosome.rs", line: 441, error: Compile("Error while importing \"__wbindgen_placeholder\".\"wbindgen_describe\": unknown import. Expected Function(FunctionType { params: [I32], results: [] })") }), wasm_trace: [], native_trace: 0:


<unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: <unknown>
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
 }))
    at catchError (file:///Users/node_modules/@holochain/tryorama/node_modules/@holochain/client/lib/api/common.js:37:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at AdminWebsocket.installApp (file:///Users/node_modules/@holochain/tryorama/node_modules/@holochain/client/lib/api/common.js:13:22)
    at Scenario.addPlayerWithApp (file:///Users/node_modules/@holochain/tryorama/lib/local/scenario.js:61:25)
    at async Promise.all (index 1)
    at Scenario.addPlayersWithApps (file:///Users/node_modules/@holochain/tryorama/lib/local/scenario.js:77:25)
    at /Users/test.ts:20:26
    at Module.runScenario (file:///Users/node_modules/@holochain/tryorama/lib/local/scenario.js:131:9)
    at /Users/test.ts:10:3
    at runTest (file:///Users/node_modules/@vitest/runner/dist/index.js:439:9)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 ❯ catchError ../node_modules/@holochain/tryorama/node_modules/@holochain/client/lib/api/common.js:37:23
 ❯ AdminWebsocket.installApp ../node_modules/@holochain/tryorama/node_modules/@holochain/client/lib/api/common.js:13:22
 ❯ Scenario.addPlayerWithApp ../node_modules/@holochain/tryorama/lib/local/scenario.js:61:25
 ❯ Scenario.addPlayersWithApps ../node_modules/@holochain/tryorama/lib/local/scenario.js:77:25
 ❯ src/my_space/schedule/appointment.test.ts:20:26
     18|     // Add 2 players with the test app to the Scenario. The returned players
     19|     // can be destructured.
     20|     const [alice, bob] = await scenario.addPlayersWithApps([appSource, appSource]);
       |                          ^
     21| 
     22|     // Shortcut peer discovery through gossip and register all agents in every
 ❯ Module.runScenario ../node_modules/@holochain/tryorama/lib/local/scenario.js:131:9
jost-s commented 10 months ago

That's probably an incompatibility between Holochain and the HDK/HDI of the zomes. Please double check that they match. If that is the source of the error, I can't do anything about this uninformative error in tryorama, but we could look at it in Holochain.

nphias commented 10 months ago

i found that by adding the package chrono = { version = "0.4" } to my cargo.toml caused the error

i am using the package for timestamp conversions when i did this .. i no longer get the error: chrono = { version = "0.4" default-feature = false} related to this bug: https://github.com/holochain/holochain/issues/1512

an error message that said ..: check your dependency crates are wasm compatible .. would have saved me a few hours

jost-s commented 10 months ago

Right, yeah! I've seen that too but didn't remember.

jost-s commented 9 months ago

I just ran into this again. On Discord it was said to pin chrono to 0.4.6 but that no longer works due to incompatibility with serde. So your solution works, disabling default features which excludes wasm-bindgen.