Discussion:
[dart-misc] Error “Unable to find modules for some sources…” in Dart
Valentin Olchowski
2018-09-12 11:24:08 UTC
Permalink
I'm learning dart and trying to make a simple webapp, wich should make it
possible to create an user.

But when I'm trying to run it, the following message appears:

[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached): Unable
to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1

[SEVERE] Failed after 2.2s

Here are my files:

main.dart

import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;

@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}

app_Component.dart

import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';

@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}

app_Component.html

<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">

routes.dart

import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;

export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);

static final all = <RouteDefinition>[
home,
newUser,
];}

routhe_paths.dart

import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}

home_component.html

<h4>Hallo {{user.firstName}}</h4>

home_component.dart

import 'package:angular/angular.dart';
import 'user.dart';

@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {

User user = new User('Axel', 'Foley', '***@sfoley.de');
}

create_new_user_component.html

<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>

create_new_user_component.dart

import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';


@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";

Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org.
'Bob Nystrom' via Dart Misc
2018-09-12 17:05:51 UTC
Permalink
What are the contents of your pubspec.yaml file?

– bob

On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should make it
possible to create an user.
[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached): Unable
to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import 'package:Muellbot/app_component.template.dart'
as ng; from Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit https://groups.google.com/a/
dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-
ba92f8b13af7%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAF8T8Lyf%2BR9kctC0-_O8oZBuEVZknJ1XLL500GQhGzW-OJxfMg%40mail.gmail.com.
Valentin Olchowski
2018-09-12 17:08:26 UTC
Permalink
pubspec.yaml

name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
# author: valentin <***@example.com>

environment:
sdk: '>=2.0.0 <3.0.0'

dependencies:
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19

dev_dependencies:
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should make it
possible to create an user.
[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached): Unable
to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org.
'Bob Nystrom' via Dart Misc
2018-09-12 17:22:12 UTC
Permalink
Is your Dart file "app_Component.dart" or "app_component.dart"? It looks
like you're saying it's the former, but you are importing the latter. URIs
are case-sensitive, so it probably thinks you are referring to a different
file.

(The official style for libraries is to not use capital letters
<https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores>,
to avoid cases like this.)

Cheers!

– bob


On Wed, Sep 12, 2018 at 10:08 AM, Valentin Olchowski <
Post by 'Bob Nystrom' via Dart Misc
pubspec.yaml
name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
sdk: '>=2.0.0 <3.0.0'
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should make
it possible to create an user.
Unable to find modules for some sources, this is usually the result of
either a bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure (if
importing a generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit https://groups.google.com/a/da
rtlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7
%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit https://groups.google.com/a/
dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-
76433c684658%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAF8T8LwbvxhRXrp8D%3DUPA4UgvyrWEpPPqNVXa7%3DmGw_qdy7R-Q%40mail.gmail.com.
Valentin Olchowski
2018-09-12 17:42:20 UTC
Permalink
Hey,

sorry this was a mistake from me, when I was creating the post, the
filename is "app_component.dart"
Post by 'Bob Nystrom' via Dart Misc
Is your Dart file "app_Component.dart" or "app_component.dart"? It looks
like you're saying it's the former, but you are importing the latter. URIs
are case-sensitive, so it probably thinks you are referring to a different
file.
(The official style for libraries is to not use capital letters
<https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores>,
to avoid cases like this.)
Cheers!
– bob
On Wed, Sep 12, 2018 at 10:08 AM, Valentin Olchowski <
Post by 'Bob Nystrom' via Dart Misc
pubspec.yaml
name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
sdk: '>=2.0.0 <3.0.0'
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should make
it possible to create an user.
Unable to find modules for some sources, this is usually the result of
either a bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure (if
importing a generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-f476b79a21f1%40dartlang.org.
'Bob Nystrom' via Dart Misc
2018-09-12 17:43:24 UTC
Permalink
Hmm... in that case, I'm out of ideas. :(

Adding Jake and Nate to the thread in case they have any.

– bob

On Wed, Sep 12, 2018 at 10:42 AM, Valentin Olchowski <
Post by Valentin Olchowski
Hey,
sorry this was a mistake from me, when I was creating the post, the
filename is "app_component.dart"
Post by 'Bob Nystrom' via Dart Misc
Is your Dart file "app_Component.dart" or "app_component.dart"? It looks
like you're saying it's the former, but you are importing the latter. URIs
are case-sensitive, so it probably thinks you are referring to a different
file.
(The official style for libraries is to not use capital letters
<https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores>,
to avoid cases like this.)
Cheers!
– bob
On Wed, Sep 12, 2018 at 10:08 AM, Valentin Olchowski <
Post by 'Bob Nystrom' via Dart Misc
pubspec.yaml
name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
sdk: '>=2.0.0 <3.0.0'
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should make
it possible to create an user.
Unable to find modules for some sources, this is usually the result of
either a bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure (if
importing a generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce
7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit https://groups.google.com/a/da
rtlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658
%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit https://groups.google.com/a/
dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-
f476b79a21f1%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-f476b79a21f1%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAF8T8LyBBwhUG-TKi5K8H%3DJZnzFPN7KBUh3zP9HE8y%2BqQC68aw%40mail.gmail.com.
Valentin Olchowski
2018-09-12 20:56:49 UTC
Permalink
Ok removing

<span *ngIf="!create" id="error">Fehler</span><span *ngIf="create" id="success">Benutzer angelegt</span>

helped.
Post by 'Bob Nystrom' via Dart Misc
Hmm... in that case, I'm out of ideas. :(
Adding Jake and Nate to the thread in case they have any.
– bob
On Wed, Sep 12, 2018 at 10:42 AM, Valentin Olchowski <
Post by Valentin Olchowski
Hey,
sorry this was a mistake from me, when I was creating the post, the
filename is "app_component.dart"
Post by 'Bob Nystrom' via Dart Misc
Is your Dart file "app_Component.dart" or "app_component.dart"? It looks
like you're saying it's the former, but you are importing the latter. URIs
are case-sensitive, so it probably thinks you are referring to a different
file.
(The official style for libraries is to not use capital letters
<https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores>,
to avoid cases like this.)
Cheers!
– bob
On Wed, Sep 12, 2018 at 10:08 AM, Valentin Olchowski <
Post by 'Bob Nystrom' via Dart Misc
pubspec.yaml
name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
sdk: '>=2.0.0 <3.0.0'
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should
make it possible to create an user.
Unable to find modules for some sources, this is usually the result of
either a bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure (if
importing a generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it,
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-f476b79a21f1%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-f476b79a21f1%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/0d14d44c-ff91-4571-96e4-a1b22b9f15d0%40dartlang.org.
Valentin Olchowski
2018-09-13 10:45:05 UTC
Permalink
But now I got another error. The server loads and when I visit the page, it
just says

Loading...

In the console I get the message

TypeError: e.message is undefined
Post by Valentin Olchowski
Ok removing
<span *ngIf="!create" id="error">Fehler</span><span *ngIf="create" id="success">Benutzer angelegt</span>
helped.
Post by 'Bob Nystrom' via Dart Misc
Hmm... in that case, I'm out of ideas. :(
Adding Jake and Nate to the thread in case they have any.
– bob
On Wed, Sep 12, 2018 at 10:42 AM, Valentin Olchowski <
Post by Valentin Olchowski
Hey,
sorry this was a mistake from me, when I was creating the post, the
filename is "app_component.dart"
Post by 'Bob Nystrom' via Dart Misc
Is your Dart file "app_Component.dart" or "app_component.dart"? It
looks like you're saying it's the former, but you are importing the latter.
URIs are case-sensitive, so it probably thinks you are referring to a
different file.
(The official style for libraries is to not use capital letters
<https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores>,
to avoid cases like this.)
Cheers!
– bob
On Wed, Sep 12, 2018 at 10:08 AM, Valentin Olchowski <
Post by 'Bob Nystrom' via Dart Misc
pubspec.yaml
name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
sdk: '>=2.0.0 <3.0.0'
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should
make it possible to create an user.
Unable to find modules for some sources, this is usually the result of
either a bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure (if
importing a generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it,
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/70efce7a-7dbc-4bd6-8f6d-ba92f8b13af7%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/0d8a40ca-c0a2-45d1-9f51-76433c684658%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
To view this discussion on the web visit
https://groups.google.com/a/dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-f476b79a21f1%40dartlang.org
<https://groups.google.com/a/dartlang.org/d/msgid/misc/9889b754-2c93-4d19-b00a-f476b79a21f1%40dartlang.org?utm_medium=email&utm_source=footer>
.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/33495da1-6fc6-4213-aca0-4b84fb4a6d1a%40dartlang.org.
'Jake Macdonald' via Dart Misc
2018-09-13 14:34:50 UTC
Permalink
There is a fix out for this error, but it hasn't been published yet. I can
publish that today, but I think this is just hiding some other error (this
is in the error handling code for module loading).

On Thu, Sep 13, 2018 at 3:45 AM Valentin Olchowski <
Post by Valentin Olchowski
But now I got another error. The server loads and when I visit the page,
it just says
Loading...
In the console I get the message
TypeError: e.message is undefined
Post by Valentin Olchowski
Ok removing
<span *ngIf="!create" id="error">Fehler</span><span *ngIf="create" id="success">Benutzer angelegt</span>
helped.
Post by 'Bob Nystrom' via Dart Misc
Hmm... in that case, I'm out of ideas. :(
Adding Jake and Nate to the thread in case they have any.
– bob
On Wed, Sep 12, 2018 at 10:42 AM, Valentin Olchowski <
Post by Valentin Olchowski
Hey,
sorry this was a mistake from me, when I was creating the post, the
filename is "app_component.dart"
Post by 'Bob Nystrom' via Dart Misc
Is your Dart file "app_Component.dart" or "app_component.dart"? It
looks like you're saying it's the former, but you are importing the latter.
URIs are case-sensitive, so it probably thinks you are referring to a
different file.
(The official style for libraries is to not use capital letters
<https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores>,
to avoid cases like this.)
Cheers!
– bob
On Wed, Sep 12, 2018 at 10:08 AM, Valentin Olchowski <
Post by 'Bob Nystrom' via Dart Misc
pubspec.yaml
name: Muellbot
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
sdk: '>=2.0.0 <3.0.0'
angular: ^5.0.0
angular_components: ^0.9.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
Post by 'Bob Nystrom' via Dart Misc
What are the contents of your pubspec.yaml file?
– bob
On Wed, Sep 12, 2018 at 4:24 AM, Valentin Olchowski <
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should
make it possible to create an user.
Unable to find modules for some sources, this is usually the result of
either a bad import, a missing dependency in a package (or possibly a
dev_dependency needs to move to a real dependency), or a build failure (if
importing a generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAMg1okQP9vDpsqv4Fg5GHJH4B3%2BHUJm8h5O0OFSkCgi%3DMTYLAA%40mail.gmail.com.
Paul Senni
2018-11-30 02:26:49 UTC
Permalink
hello, I am getting this same error, but all my naming is correct

I am learning this from a code lab from the web dev
website: https://webdev.dartlang.org/angular/tutorial/toh-pt1

app_component.dart

import 'package:angular/angular.dart';
import 'package:angular_forms/angular_forms.dart';
import 'package:hero/src/hero/hero.dart';
import 'package:hero/src/hero/mock_heroes.dart';


// AngularDart info: https://webdev.dartlang.org/angular
// Components info: https://webdev.dartlang.org/components

@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
// template: '''
// <h1>{{title}}</h1>
// <h2>{{hero.name}}</h2>
// <div><label>id:</label>{{hero.id}}</div>
// <div>
// <label>name:</label>
// <input [(ngModel)]="hero.name" placeholder="name">
// </div>
// ''',
directives: [formDirectives],
)
class AppComponent {
final title = 'Tour of Heroes';
// var hero = 'Windstorm';
// Hero hero = Hero(1, 'Windstorm');
final List<Hero> heroes = mockHeroes;
// final Hero hero = Hero(1, 'Jack');
}



app_component.html
<h1>{{title}}</h1>
<!-- <h2>{{hero.name}}</h2> -->
<h2>Heroes</h2>
<!-- <div><label>id:</label>{{hero.id}}</div> -->
<!-- <div>
<label>name:</label>
<input [(ngModel)]="hero.name" placeholder="name">
</div> -->

<ul class="heroes">
<li *ngFor="let hero of heroes">
<span class="badge">{{hero.id}}</span> {{hero.name}}
</li>
</ul>



On Wednesday, September 12, 2018 at 6:44:36 PM UTC+3, Valentin Olchowski
Post by Valentin Olchowski
I'm learning dart and trying to make a simple webapp, wich should make it
possible to create an user.
[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached): Unable
to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
import 'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.template.dart at 9:1 import
'package:Muellbot/app_component.template.dart' as ng; from
Muellbot|web/main.dart at 2:1
[SEVERE] Failed after 2.2s
main.dart
import 'package:angular/angular.dart';import 'package:Muellbot/app_component.template.dart' as ng;import 'package:angular_router/angular_router.dart';
import 'main.template.dart' as self;
@GenerateInjector(
routerProvidersHash,)final InjectorFactory injector = self.injector;
void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);}
app_Component.dart
import 'package:angular/angular.dart';import 'package:angular_router/angular_router.dart';
import 'src/routes.dart';
@Component(
selector: 'my-app',
styleUrls: ['app_component.css'],
templateUrl: 'app_component.html',
directives: [routerDirectives],
exports: [RoutePaths, Routes],
)class AppComponent {
}
app_Component.html
<h1>MÃŒllbot</h1><nav>
<a [routerLink]="RoutePaths.home.toUrl()"
[ routerLinkActive]="'active'">Home</a>
<a [routerLink]="RoutePaths.newUser.toUrl()"
[routerLinkActive]="'active'">Neuen Benutzer anlegen</a></nav><router-outlet [routes]="Routes.all"></router-outlet><img src="logo.png" width="50%">
routes.dart
import 'package:angular_router/angular_router.dart';
import 'route_paths.dart';import 'home_component.template.dart' as home_template;import 'create_new_user_component.template.dart' as new_user_template;
export 'route_paths.dart';
class Routes {
static final home = RouteDefinition(
routePath: RoutePaths.home,
component: home_template.HomeComponentNgFactory,
);
static final newUser = RouteDefinition(
routePath: RoutePaths.newUser,
component: new_user_template.NewUserComponentNgFactory,
);
static final all = <RouteDefinition>[
home,
newUser,
];}
routhe_paths.dart
import 'package:angular_router/angular_router.dart';
class RoutePaths {
static final home = RoutePath(path: 'home');
static final newUser = RoutePath(path: 'newUser');
}
home_component.html
<h4>Hallo {{user.firstName}}</h4>
home_component.dart
import 'package:angular/angular.dart';
import 'user.dart';
@Component(
selector: 'home',
templateUrl: 'home_component.html')
class HomeComponent {
}
create_new_user_component.html
<h3>Neuen Benutzer anlegen</h3><div>
<span *ngIf="!create" id="error">Fehler</span>
<span *ngIf="create" id="success">Benutzer angelegt</span>
<table>
<tr>
<td><label>Vorname:</label></td><td><input #firstName/></td>
<td><label>Nachname:</label></td><td><input #lastName/></td>
</tr><tr>
<td><label>Email:</label></td><td><input #email/></td>
</tr><tr>
<td><label>Passwort:</label></td><td><input #password/></td>
<td><label>Passwort wiederholen:</label></td><td><input #passwordRe/></td>
</tr><tr>
<td><button (click)="add(firstName.value, lastName.value, email.value, password.value)">HinzufÃŒgen</button></td>
</tr>
</table></div>
create_new_user_component.dart
import 'dart:async';import 'dart:convert';import 'package:http/http.dart';
import 'package:angular/angular.dart';
@Component(
selector: 'new-user',
templateUrl: 'create_new_user_component.html')
class NewUserComponent {
bool create = false;
final Client _http;
static final _headers = {'Content-Type': 'application/json'};
final url = "http://localhost:4040/user/new";
Future<void> add(String firstName, String lastName, String email, String password) async {
try {
final response = await _http.post(url, headers: _headers, body: json.encode({'firstName': firstName, 'lastName': lastName, 'email': email, 'password': password}));
if (response.statusCode == 200) {
create = true;
}
} catch (e) {
throw new Exception(e);
}
}}
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/11f035c9-031c-4473-9613-26cdf199fb5a%40dartlang.org.
Continue reading on narkive:
Search results for '[dart-misc] Error “Unable to find modules for some sources…” in Dart' (Questions and Answers)
21
replies
Do you bealive we are in the latter days as described in the bible?
started 2007-03-27 23:54:39 UTC
religion & spirituality
Loading...