Can't run simple dart web project; no errors

95 views
Skip to first unread message

Guyren Howe

unread,
Jul 5, 2021, 5:27:32 PM7/5/21
to Dart Misc
I created the example web project and ran it fine in Android Studio 4.2.2 on my M1 Mac using Dart 2.13.4.

Then I added some functions and modified main(), working toward a web project. I currently have a single main file with all the content in it.

When I run this in Android Studio, it starts up without any errors in the console, opens a web page and then does nothing. The inspector in the browser shows for main.dart.js:

Failed to load resource: the server responded with a status of 404 (Not Found)

There is nothing in the console about this in Android Studio.

If I run it using webdev serve, I get similar behavior: a blank page and a 404 loading main.dart.js, with nothing relevant displayed in the webdev output.

I can compile my current main.dart using dart2js without error. The dart analyzer shows no problem.

I am pretty much at a loss at this point regarding how to fix this.

I also feel that how wwebdev projects *work* is inadequately explained that I’ve seen. I just start webdev in the root of my project and it… assumes I have web/index.html and web/main.dart? Does it basically just compile and serve any files inside web? Hierarchically? Does it serve static content? etc
Reply all
Reply to author
Forward
0 new messages