-
Notifications
You must be signed in to change notification settings - Fork 15
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
interactive command does not work as shown #93
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hmm, I cannot reproduce locally:
But your description looks similar to #92. Since I do not have a reproducible environment, could you please check whether it stucks (or provide a reproducible env)? For example, one way is to run a debugger on it, another way is to add a lot of |
I removed the dart-sdk from /opt/, downloaded, extracted and copied dart sdk 3.4.4 to /opt/.
However the problem persists and I cannot see the interactive prompt >>>, instead this is the output:
|
I am just a beginner with dart. I cloned the repo, and hit
|
I didn't install Flutter, I only installed dart from the zip archive. Can this be the problem? |
Hi, as is suggested above, could you please try to add a bunch of
|
@oezg Looks like OS-related bug for me. Cannot reproduce on Windows and MacOS. Try to debug |
Not working on mac os to. Probably not supported with Dart 3.4.3 or Dart 3 at all |
@fzyzcjy I tried to dig deeper and discovered that I also found out that when running with Dart SDK version: 3.4.3 (stable) (Tue Jun 4 19:51:39 2024 +0000) on "macos_arm64" |
@Maksimka101 Hmm... Do you mean it is stuck at calling Dart's vm service? (or it is stuck at dart_interactive code), if the former maybe we can create an issue on Dart repo asking about this. |
I'm talking about dart's vm service |
@fzyzcjy Can you please tell what is your machine, os, dart version and how do you launch the app (with or without compiling it)? |
@Maksimka101 I personally use macos, and you can check https://github.com/fzyzcjy/dart_interactive/blob/master/.github/workflows/ci.yaml for various machines and versions etc |
For me, there is a race condition. Execution gets stuck here normally:
But putting a sleep at the beginning of main function gets it to work.
Tested by running
|
@natrys curious why would getIsolateIds would introduce a race condition... But if this is stuck, maybe we can do a workaround: We can change |
@fzyzcjy Had time to do a little more testing. I feel like the issue might be in the relationship between these two lines: dart_interactive/packages/interactive/lib/src/executor.dart Lines 33 to 35 in 1e9e1ae
As is, it gets stuck when executing the second line. Tried adding retry logic like: VmServiceWrapper vm;
WorkspaceIsolate workspaceIsolate;
while (true) {
try {
vm = await VmServiceWrapper.create();
workspaceIsolate = await WorkspaceIsolate.create(vm, workspaceFileTree)
.timeout(const Duration(seconds: 1));
break;
} on TimeoutException {
print('Trying again...');
await Future<void>.delayed(const Duration(seconds: 1));
}
} It works in the second try as I would expect. However something is still not quite right because when I do C-d on the repl, then it gets stuck instead of exiting cleanly. |
Hmm... Again that's quite weird... Maybe the next step can be reducing the same to bare minimum, i.e. only call Dart vm apis. Then, if the problem still exists, that may be a bug related to Dart lang, and we can create a bug report there. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have the same issue on linux. Just installed and when I run
|
Just tested with Dart 3.7.0 beta on Windows 11, and I don't have the |
Can confirm the issue on macOS 14.7.2 I have Dart installed through Flutter. Edit: Deactivating and activating seemed to work |
I guess this bugs existence is quite well established alredy, but in any case can report that this issue happens on freshly installed
|
this problem is in my computer , dart version is 3.4.3, in windows wsl. output is Run: /home/u/.x-cmd.root/local/data/asdf/installs/dart/3.4.3/bin/dart [--enable-vm-service=42045, file:///home/soluty/.pub-cache/global_packages/i |
Describe the bug
I used the installation guide but the interactive more did not work.
To Reproduce
after the installation and adding to the PATH I ran interactive but the repl did not start as shown in the website.
Instead I get this message:
Run: dart [--enable-vm-service=43935, file:///home/..../.pub-cache/global_packages/interactive/bin/interactive.dart-3.4.3.snapshot, --vm-service-was-enabled] Workspace: /tmp/dart_interactive_workspace_2024-06-12T010133935832 The Dart VM service is listening on http://127.0.0.1:43935/fdZBpSYCk6k=/ The Dart DevTools debugger and profiler is available at: http://127.0.0.1:43935/fdZBpSYCk6k=/devtools?uri=ws://127.0.0.1:43935/fdZBpSYCk6k=/ws
Expected behavior
the terminal will show the repl with >>> and respond to my prompts
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
when I go to the link, connected app type is Dart CLI,
VM Service Connection: ws://127.0.0.1:43935/fdZBpSYCk6k=/ws
The text was updated successfully, but these errors were encountered: