Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging dart in visual studio code

I'm new to Dart/Visual studio code and have hit a wall setting up one of the predefined stagehand apps "web-angular".

I've installed the dart language support extension and created a new folder called c:\webdev\Angular_dart . From within the terminal in VSCode i ran "stagehand web-angular", then "pub get" then "pub global run webdev serve web:8888"

I'm able to see the default web page (a todo list) but when I hit F5 from within VSCode it gives me an error saying it can't see any of the files in my lib folder.

The first one it hits is..

web/main.dart:2:8: Error: Error when reading 'lib/app_component.template.dart': The system cannot find the file specified.

import 'package:Angular_Dart/app_component.template.dart' as ng;

it looks like my .packages file is setup correctly as my last line reads

Angular_Dart:lib/

And my launch.json configuration is

"name": "Dart",
"program": "web/main.dart",
"request": "launch",
"type": "dart"

Has anyone seen this?

Thanks in advance.

like image 297
cjmarques Avatar asked Aug 01 '26 11:08

cjmarques


1 Answers

Right now it's simple. Use following configuration:

{
    "name": "Dart",
    "program": "web/index.html",
    "request": "launch",
    "type": "dart"
}
  • VS Code: 1.50.1
  • Dart SDK: 2.11.0-213.1.beta

Make sure "program" points to the index HTML file.

like image 143
theanurin Avatar answered Aug 03 '26 10:08

theanurin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!