Open ThetaSinner opened 6 months ago
I'm surprised that this error can occur without throwing a runtime error before it even reaches that line. I have to improve error handling.
Does this error occur consistently each time you run hc-spin
in that environemt?
Unfortunately yes it does. This is happening in both my environments, one on my work machine that I've had for a while so I don't think it's related to any recent changes I've made in there. The other is on my personal machine and is brand new because I was having other WSL issues.
I'm not really sure what's going on here. It could be something wrong with my environments but if you know where this errors happens and could get it to give some more context about what went wrong I'd be happy to run it again and get you some more information about what's happening for me :)
Okay, some context is that this error occurs if windowInfo.agentPubKey
is not defined on this line. However windowInfo
itself must be defined because otherwise the error would be
TypeError: Cannot read properties of undefined (reading 'agentPubKey')
The agentPubKey
property is set on this line based on what has been returned by appInfo. This could be undefined then if appInfo
returned null
(which it apparently can). However, if that was the case, then I would already expect an error on that line 342 like (I tried that locally)
TypeError: Cannot read properties of null (reading 'agent_pub_key')
So I'm just confused how that can even happen. Can you try to run hc-spin by explicitly setting the app-id via the --app-id
argument to see whether it might in your case use a wrong app id for which appInfo returns null?
And another question: Did you try to run the same project in a non-WSL2 environment yet?
Ahh okay, thank you for pointing me at the right code. That helped me debug my mistake, the message I'm getting back from the appInfo
call is:
[1] Got app info: {"type":{"deserialization":null},"data":"Bytes(Deserialize(\"wrong msgpack marker FixStr(8)\"))"}
I'd expect the JS client to have errored that response though... because the the response type clearly doesn't match the request type. Maybe a bug there?
But the problem is me working on weekly Holochain but using 0.200.10 of hc-spin
. I've switched to 0.300.2
and it works just fine.
Did you try to run the same project in a non-WSL2 environment yet?
I haven't, just my WSL environments, but as it turns out WSL isn't messing me up, I am messing me up :)
Ah great! I'll leave this issue open nevertheless until I added proper error handling for the null
case.
I'm getting this log when running on WSL2 (Ubuntu 22.04), with
@holochain/hc-spin@^0.200.10