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

Pub can't serve main.dart from nested folder when using DDC #30246

Closed
lexaknyazev opened this issue Jul 24, 2017 · 2 comments
Closed

Pub can't serve main.dart from nested folder when using DDC #30246

lexaknyazev opened this issue Jul 24, 2017 · 2 comments
Assignees

Comments

@lexaknyazev
Copy link
Contributor

Dart SDK 1.25.0-dev.7.0

  1. Create a bare-bones web app from template.
  2. Move main.dart from web to web/scripts, update reference in HTML.
  3. Run pub serve with Dart2JS, open webpage. Everything works fine:
Loading source assets...
Loading dart_to_js_script_rewriter transformers...
Serving pub_bug web on http://localhost:8080
Build completed successfully
[web] GET Served 3 assets.
[Info from Dart2JS]:
Compiling pub_bug|web/scripts/main.dart...
[Info from Dart2JS]:
Took 0:00:03.435261 to compile pub_bug|web/scripts/main.dart.
Build completed successfully
[web] GET Served 2 assets.
  1. Re-run with DDC: pub serve --web-compiler=dartdevc, open webpage.
Loading source assets...
Loading dart_to_js_script_rewriter transformers...
Serving pub_bug web on http://localhost:8080
Build completed successfully
[web] GET Served 3 assets.
[web] GET Served 4 assets.
[web] GET main.dart.bootstrap.js => Could not find asset pub_bug|web/main.dart.
  1. Browser's JS console contains:
main.dart.bootstrap.js Failed to load resource: the server responded with a status of 404 (Not Found)
require.js:143 Uncaught Error: Script error for "main.dart.bootstrap"
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:168)
    at HTMLScriptElement.onScriptError (require.js:1738)
@vsmenon
Copy link
Member

vsmenon commented Aug 30, 2017

@jakemac53 @natebosch

@jakemac53
Copy link
Contributor

While you wait for this to get merged into the sdk you can test it out by adding the following to your pubspec.yaml:

dev_dependencies:
  pub:
    git: https://github.com/dart-lang/pub.git

And then running pub run pub serve --web-compiler=dartdevc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants