Calva: command 'calva.connect' not found

Created on 24 Mar 2019  路  20Comments  路  Source: BetterThanTomorrow/calva

using latest vscode insiders
i keep getting command 'calva.connect' not found

Most helpful comment

Version 1.3.65 released, fixing this problem. A ton of thanks to, @teves-castro, for investigating and finding the culprit!

Leaving the issue open a day or two, so that people who encounter the issue can see it and know how they can fix it.

I think this is how you get an invite to the Slack: https://clojurians.herokuapp.com

All 20 comments

That doesn't sound good at all. You don't get that with main vscode?

If you have some time, please check if you see something in the developer console on insiders that hint about what the problem could be.

Cannot activate extension 'Calva Clojure Formatter' because it depends on extension 'cospaia.clojure4vscode', which failed to activate
extensionService.ts:799 Cannot activate extension 'Calva Paredit' because it depends on extension 'cospaia.clojure4vscode', which failed to activate.

image

image

Hmmm... That last error you posted, cannot find module 'paredit.js', looks like the culprit. But why this would happen, is beyond me right now. I'll have to update my insiders to latest and see if I can figure it out.

Thanks for alerting me! This can quickly become a big problem.

So, this doesn't happen to me. Using Version 1.33.0-insider (1.33.0-insider). Is that the same version as you are using?

I'm also getting 'calva.connect' command not found but I get a different error trace:
image

I believe the problem might be related to the usage of ImmutableJS.

In extension.ts the initialData object is wrapped into an ImmutableJS structure, which should allow any of its members to be accessed by using get().

Although this is working fine for the simple members (i.e. connecting, connected, etc.) when outputChannel if retrieved an instance of an ImmutableJS structure is till being returned. This needs to be first unwrapped using toJS().

So if instead of the following code:

let chan = state.deref().get('outputChannel');
chan.appendLine("Calva activated.");

we had:

let chan = state.deref().get('outputChannel').toJS();
chan.appendLine("Calva activated.");

all would be working.

Can this be related to some recent changes in ImmutableJS itself?

In addition to the errors referenced, I also get this error (on vscode 1.33.0):

Activating extension 'cospaia.clojure4vscode' failed: chan.appendLine is not a function.

Yup, this is related. Wherever the channel object is used log something to the console this happens.

Thanks for the help, @teves-castro ! Much appreciated. I will be looking at this today, if I get just a tiny moment over.

Question to you all. Has this entered the regular vscode now, or is it still with Insiders? Thing is, I don't get this. I even didn't get it when I tried Insiders, which makes it a bit hard to diagnose how well any fix I come up with works, of course.

This is ancient code in Calva, so, yes, something has moved, and ImmutableJS might be the part. I've been wanting to handle state a bit smarter a while now. Actually had citrus do it for me in a test branch a while, but I'll probably choose a more JS-y path to start with.

No problem @PEZ. Yes I'm on stable vscode. I could even do PR to fix this but I didn't felt too happy with the hack solution I found, so I'll let you have a look at this when you have time.
Thanks!

This is totally strange. If I try calling toJS() on the returned object I get errors because that does not exist (obviously, since I do get an output channel back, and not an ImmutableJS structure).

@teves-castro, I'd appreciate that PR. It will take some research to figure out why it happens, I guess, so that the solution works even in cases like on my (and on tons of happy Calva users machines from what I know).

Let's compare OSs: I'm on MacOS Mojave. And I know see that if I Check for updates in vscode it does have an update waiting for me. I dare not apply it right now because I am at work, but I am guessing that update will cause this error to appear.

So the fix much check for is toJS() is there. Maybe it can be be added as a function in the state module and we change all the places where we get the channel to use that function? Again, yes, if you can help me with a PR, I'll be including you in my bedtime prayers for weeks, @teves-castro :heart:. This is about to bite poor Calva users hard and I must swicth my attention to my get-food-on-the-table work right now. 馃槩

I can certainly do that Peter! But before I do that I will check with a wither audience (colleagues of mine) also using this extension day to day if they have the problem also.

I am looking at it now. Also have colleagues who get affected. Please join #calva-dev on Clojurian's Slack to sync our efforts.

I've just checked and upgrading code to the last version breaks provokes this. Wondering if this might be cause by a mismatch between versions of ImmutableJS used by vscode itself and the version being used by calva.

And I can reproduce it in insiders now, so should be able to fix this now.

About versions of ImmutableJS. I don't understand why some other version than the one Calva specifies would be in play. Also, I tried to upgrade Calva's to the latest ImmutableJS but that did not provoke the error. Something else is going on. But in my quick-fix I will not bother with what is the root cause (violating my principles here), and instead just check if toJS is there or not.

I don't understand that either. And the hack sounds like it might do the trick for now.

How do I get an invite for the Clojurian's Slack?

Version 1.3.65 released, fixing this problem. A ton of thanks to, @teves-castro, for investigating and finding the culprit!

Leaving the issue open a day or two, so that people who encounter the issue can see it and know how they can fix it.

I think this is how you get an invite to the Slack: https://clojurians.herokuapp.com

Yup, checks out! Working on my side! It was a pleasure, and thanks for your awesome work!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zerg000000 picture zerg000000  路  6Comments

taylorwood picture taylorwood  路  3Comments

TwiceII picture TwiceII  路  6Comments

PEZ picture PEZ  路  3Comments

denistakeda picture denistakeda  路  6Comments