You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FWIW for anyone doing web apps, while Dart Code doesn't have supports, I still managed to get some basic behaviour for hitting F5 with the following config in Code (this is without any Dart Code changes - you can do this today; though it shouldn't be required when Dart Code has real web support). F5 kicks off the Chrome debugger, but first it invokes pub run build_runner serve and it has some regexes so Code knows when it's idle (versus building), so it will wait until the build is finished before opening the browser.
Sorry, I should've scrolled up further - the last instructions above are just setting up a task that runs a command. The error you're getting is because pub isn't in your PATH environment variable.
The second error you posted is because you ran pub serve, but the command is now pub run build_runner serve.
However, you'd be better enabling the build_runner tasks in VS Code - they're currently behind a preview flag, see the release notes here:
Considering this addressed by #2113. In the next release (beta here: https://github.com/Dart-Code/Dart-Code/releases/tag/v3.7.0-beta.1) if the launch config has program starting with web/ we'll invoke the Web debugger (the one originally created for forked flutter_web) when pressing F5.
There's undoubtedly lots of room for improvement (for example supporting projects without a launch.json) but they can be dealt with individually (so if you try this out and hit bugs or have suggestions, please do file issues).
Reacted by Marco Jakob, Dmitry Ivanov, Lasindu Weerasinghe and Maksim Lin
Considering this addressed by #2113. In the next release (beta here: https://github.com/Dart-Code/Dart-Code/releases/tag/v3.7.0-beta.1) if the launch config has program starting with web/ we'll invoke the Web debugger (the one originally created for forked flutter_web) when pressing F5.
There's undoubtedly lots of room for improvement (for example supporting projects without a launch.json) but they can be dealt with individually (so if you try this out and hit bugs or have suggestions, please do file issues).
I keep seeing "launching" in the bottom and a process of Chrome is loaded but Dart is not working in the browser and no errors are displayed in Chrome dev tools or VS Code. Can you please help me give me a link to check "how to launch a Bare Bones Web App" in VS Code.
Thanks in advance
@LassazVegaz if you run the Dart: New Project command in VS Code there's an Angular web app that I usually use for testing (you'll need to create a launch.json with Debug: Open launch.json and set "program": "web"). If this doesn't work, please capture logs (using the Dart: Capture Logs command and untick Analysis Server but leave everything else ticked) and file a new issue and I'll take a look. Thanks!
Activity
[-]Add the ability to run Dart web apps via DDC[/-][+]Add the ability to run Dart web apps using DDC[/+][-]Add the ability to run Dart web apps using DDC[/-][+]Add the ability to run Dart web apps[/+]marcojakob commentedon Sep 5, 2016
Something similar to what Webstorm has would be great. An opinionated list of priorities:
pub buildmenu in editorDanTup commentedon Jul 23, 2017
Opened #386 to start collecting some requirements/notes for how this should work.
DanTup commentedon Apr 6, 2018
FWIW for anyone doing web apps, while Dart Code doesn't have supports, I still managed to get some basic behaviour for hitting
F5with the following config in Code (this is without any Dart Code changes - you can do this today; though it shouldn't be required when Dart Code has real web support). F5 kicks off the Chrome debugger, but first it invokespub run build_runner serveand it has some regexes so Code knows when it's idle (versus building), so it will wait until the build is finished before opening the browser.tasks.json:
launch.json:
Source maps for the files in
webseem to work out of the box, but I haven't had chance to dig into other files (like the SDK) yet.mirkancal commentedon Oct 14, 2019
@DanTup the above configuration is not working with Dart 2. I have changes "pub" with "webdev" in jsons but it says command not found.
DanTup commentedon Oct 14, 2019
@mirkancal there are no tasks registered for
webdev, onlypubandflutter. Why did you change it - what happens when you usepub?mirkancal commentedon Oct 14, 2019
@DanTup
It gaves me this. Then I've tried "pub serve" on my terminal and it says:
After that I thought pub dev is no longer being used and change the pub's with webdev in the above configuration.
DanTup commentedon Oct 14, 2019
Sorry, I should've scrolled up further - the last instructions above are just setting up a task that runs a command. The error you're getting is because
pubisn't in yourPATHenvironment variable.The second error you posted is because you ran
pub serve, but the command is nowpub run build_runner serve.However, you'd be better enabling the build_runner tasks in VS Code - they're currently behind a preview flag, see the release notes here:
https://dartcode.org/releases/v2-20/#preview-build_runner-tasks
Let me know if you still have any issues using them.
DanTup commentedon Nov 28, 2019
Considering this addressed by #2113. In the next release (beta here: https://github.com/Dart-Code/Dart-Code/releases/tag/v3.7.0-beta.1) if the launch config has
programstarting withweb/we'll invoke the Web debugger (the one originally created for forked flutter_web) when pressingF5.There's undoubtedly lots of room for improvement (for example supporting projects without a launch.json) but they can be dealt with individually (so if you try this out and hit bugs or have suggestions, please do file issues).
LassazVegaz commentedon Aug 1, 2020
I keep seeing "launching" in the bottom and a process of Chrome is loaded but Dart is not working in the browser and no errors are displayed in Chrome dev tools or VS Code. Can you please help me give me a link to check "how to launch a Bare Bones Web App" in VS Code.
Thanks in advance
DanTup commentedon Aug 3, 2020
@LassazVegaz if you run the Dart: New Project command in VS Code there's an Angular web app that I usually use for testing (you'll need to create a
launch.jsonwith Debug: Open launch.json and set"program": "web"). If this doesn't work, please capture logs (using the Dart: Capture Logs command and untick Analysis Server but leave everything else ticked) and file a new issue and I'll take a look. Thanks!