1

I have a dart polymer project being served up by an ASP.NET MVC site. The application page is actually a cshtml file that is in a different directory than the rest of the dart files. Besides this, everything is laid out in an idiomatic fashion. When running in Dartium, everything works great. When I run as javascript, I get the message boot.js only works in Dartium. Run the build.dart tool to compile a depolyable JavaScript version.

This scenario seems like it will be difficult to accommodate. Any ideas how I can get the application working as javascript while keeping it as a cshtml file served up by ASP.NET MVC?

1 Answer 1

3

This is a known issue. Try using this version of build.dart:

import 'dart:io';
import 'package:polymer/component_build.dart';
import 'package:polymer/deploy.dart' as deploy;

void main() {
  build(new Options().arguments, ['web/index.html']).then((_) => deploy.main());
}

You might get a message about a missing index.html_bootstrap.dart.js file. Dart engineers are working on making all of this work more smoothly and you should soon be able to run the deploy script through the editor.

Meanwhile, there is a discussion of this very issue on the web-ui mailing list if anyone's interested:

https://groups.google.com/a/dartlang.org/d/msg/web-ui/mLsdykraJdA/k77QuP1T2_sJ

I'll update this answer when a better alternative to the current solution is implemented.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Shailen. There is still an issue with running the build/deploy steps with a CSHTML file. It predictably fails when it encounters Razor syntax. I imagine this would be pretty difficult to accommodate. For now, I've just made it a static HTML page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.