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

[REPL Window] undefined namespace when starting a shadow-cljs cljs REPL Window #115

Closed
PEZ opened this issue Feb 4, 2019 · 6 comments
Closed
Labels

Comments

@PEZ
Copy link
Collaborator

@PEZ PEZ commented Feb 4, 2019

This is using the preview of the coming Calva with that spiffy REPL Window:

Opening a ClojureScript REPL in a shadow-cljs project (Calva itself as it happens) the prompt displays:

undefined=>

I don't have the time right now to investigate it further, not even if the namespace really is undefined 😄, so just dumping the bug report here.

@PEZ PEZ added the repl-window label Feb 14, 2019
@cfehse

This comment has been minimized.

Copy link
Contributor

@cfehse cfehse commented Oct 15, 2019

This is fixed in version 2.0.49.

@cfehse cfehse closed this Oct 15, 2019
@cfehse

This comment has been minimized.

Copy link
Contributor

@cfehse cfehse commented Oct 16, 2019

This was not fixed in version 2.0.49!

The root cause for the problem is that the cljs repl is connected but no application is connected. In this situation the code:

let res = this.session.eval("nil");
await res.value;

The returned promise contains literally nothing and the resulting res.ns is undefined.

I tested this issue with the calva cljs-lib - and I have no idea how to "connect an application to the REPL" for that project.

@cfehse cfehse reopened this Oct 16, 2019
@PEZ

This comment has been minimized.

Copy link
Collaborator Author

@PEZ PEZ commented Oct 16, 2019

@PEZ

This comment has been minimized.

Copy link
Collaborator Author

@PEZ PEZ commented Oct 16, 2019

It is not much we can do about ”no prompt when no app”, but we could, maybe, detect the situation. I have tried many times, and failed. That is not to say it is not possible. I had a chat with Thomas Heller about this some months ago, and he mentioned a message bus that shadow-cljs has, that could probably be used to make Calva know what state the connection is in.

@cfehse

This comment has been minimized.

Copy link
Contributor

@cfehse cfehse commented Oct 16, 2019

You press F5 😄

That's a problem: you cannot run the debug instance in the directory you are debugging from - at least not on Windows. So I made a copy of calva and ran the debugged calva there. This will not start the clsj-lib. At least not for me.

@cfehse

This comment has been minimized.

Copy link
Contributor

@cfehse cfehse commented Oct 16, 2019

It is not much we can do about ”no prompt when no app”, but we could, maybe, detect the situation. I have tried many times, and failed. That is not to say it is not possible. I had a chat with Thomas Heller about this some months ago, and he mentioned a message bus that shadow-cljs has, that could probably be used to make Calva know what state the connection is in.

Unfortunately shadow-cljs simply returns nothing instead of an error.

@PEZ PEZ closed this in e61a229 Oct 24, 2019
sauvala added a commit to sauvala/calva that referenced this issue Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.