lsp-dart icon indicating copy to clipboard operation
lsp-dart copied to clipboard

Debug web app

Open sudo-human opened this issue 4 years ago • 18 comments

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"

sudo-human avatar Apr 30 '21 17:04 sudo-human

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 avatar Apr 30 '21 18:04 ericdallo

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 avatar May 01 '21 02:05 ericdallo

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

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

ericdallo avatar May 01 '21 02:05 ericdallo

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 avatar May 01 '21 13:05 sudo-human

I have also tried downgrading emacs to 27

sudo-human avatar May 01 '21 13:05 sudo-human

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?

ericdallo avatar May 01 '21 14:05 ericdallo

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

sudo-human avatar May 01 '21 16:05 sudo-human

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

sudo-human avatar May 01 '21 16:05 sudo-human

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

ericdallo avatar May 01 '21 16:05 ericdallo

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

sudo-human avatar May 01 '21 16:05 sudo-human

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 :/

ericdallo avatar May 01 '21 16:05 ericdallo

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

sudo-human avatar May 01 '21 16:05 sudo-human

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

sudo-human avatar May 01 '21 16:05 sudo-human

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...

ericdallo avatar May 01 '21 16:05 ericdallo

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

Any help from this?

sudo-human avatar May 01 '21 17:05 sudo-human

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

ericdallo avatar May 01 '21 17:05 ericdallo

@ps-143 could you try the same steps from https://github.com/emacs-lsp/lsp-dart/issues/102 ?

ericdallo avatar May 15 '21 01:05 ericdallo

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.

ranjanified avatar Jun 29 '23 07:06 ranjanified