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

Debug web app #101

Open
sudo-human opened this issue Apr 30, 2021 · 18 comments
Open

Debug web app #101

sudo-human opened this issue Apr 30, 2021 · 18 comments
Assignees
Labels
bug Something isn't working

Comments

@sudo-human
Copy link

Describe the bug
When using dap-debug and selecting chrome as a device, it gets stuck on launching.

To Reproduce

  1. Run dap-debug
  2. Select - Flutter::Debug
  3. Select - Chrome device

Expected behavior
It should open the app in chrome.

Screenshots
Screenshot from 2021-04-30 23-06-47

Screenshot from 2021-04-30 23-08-10

Screenshot from 2021-04-30 23-08-42

Version
Include here the result of: M-x lsp-dart-version
[LSP Dart] 1.18.0 at 2021.04.30 @ Emacs 28.0.50
[Dart SDK] Dart SDK version: 2.12.3 (stable) (Wed Apr 14 11:02:39 2021 +0200) on "linux_x64"

@ericdallo
Copy link
Member

Thank you for the report!
It seems we are not registering correctly the debug flags for web development, I can take a look on this soon.

@ericdallo ericdallo added the bug Something isn't working label Apr 30, 2021
@ericdallo ericdallo self-assigned this Apr 30, 2021
@ericdallo
Copy link
Member

Hey @ps-143, I just tested with my flutter_sample and it worked properly 😕.

image
It connects to chrome correctly.

Doom-emacs
[LSP Dart] 1.18.1 at 2021.04.30 @ Emacs 28.0.50
[Dart SDK] Dart SDK version: 2.12.2 (stable) (Wed Mar 17 10:30:20 2021 +0100) on "linux_x64"

@ericdallo
Copy link
Member

Could you try adding this config to your emacs and testing again?

(setenv "CHROME_EXECUTABLE" "/path/to/your/chrome")

@sudo-human
Copy link
Author

I tried setting "CHROME_EXECUTABLE" to "/opt/google/google-chrome/chrome" but still it didn't work. Using flutter-run works and dap-debug works when using an android device.
I still can't figure out the problem.
I'm used snap to install the flutter and dart sdk.

@sudo-human
Copy link
Author

I have also tried downgrading emacs to 27

@ericdallo
Copy link
Member

Hum, could you try to rm ~/.emacs.d/.extension/vscode, update both lsp-dart and dap-mode to latest, run dap-dart-setup again and try again?

@sudo-human
Copy link
Author

I tried your solution but it's still not working for me.

@sudo-human
Copy link
Author

It's working absolutely fine on android devices but just not for web.

@ericdallo
Copy link
Member

I see, could you try on my flutter_sample from above?

@sudo-human
Copy link
Author

I'm using doom-emacs and I've tried flutter run and it runs fine using that, I think that dap-debug is better as it provides hot-reload as well.
I tried a new project in flutter with the boiler plate code but its still the same

@ericdallo
Copy link
Member

Really odd, dap-debug just trigger the launch using the debug.js inside the extension, which will run flutter run --machine under the hood, not sure what options left for us here :/

@sudo-human
Copy link
Author

I'm using the flutter run command from flutter.el package

@sudo-human
Copy link
Author

Earlier when I had to work on flutter I used emacs and this worked perfectly fine for me.

@ericdallo
Copy link
Member

ericdallo commented May 1, 2021

Maybe some dap-mode issue @yyoncho ?

Is there anything relevant on dap-output or dap-stderr buffers?

It's odd that works on my side...

@sudo-human
Copy link
Author

Screenshot from 2021-05-01 22-29-29

Any help from this?

@ericdallo
Copy link
Member

Nothing useful there, I don't think we have any other log besides that buffer unfortunatelly

@ericdallo
Copy link
Member

@ps-143 could you try the same steps from #102 ?

@ranjanified
Copy link

Mine's not a flutter one, Dart using web template instead. And dap-debug gives me this:

web/main.dart:1:8: Error: Dart library 'dart:html' is not available on this platform.
import 'dart:html';

From command-line, webdev serve however is fine. was just looking for a way to do it from within emacs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants