Cannot resolve file
I have a Typescript file:
///<reference path='../typings/tsd.d.ts'/>
import {inject, bindable} from 'aurelia-framework';
import {HttpClient} from 'aurelia-http-client';
interface TruckListRow {
idtruckloads:number;
truckid:string;
destination:string;
eta:string;
driver:string;
}
@inject(HttpClient)
export class App{
http:HttpClient;
TruckList : TruckListRow[];
@bindable SelectedRow : TruckListRow;
constructor (http:HttpClient){
this.http=http;
}
getTruckLoadData($event){
return new Promise((resolve, reject) => resolve({
data: this.http.get('localhost/truckload'),
count: 2
}));
};
addItem(){
console.debug('addItem');
}
deleteItem(){
console.debug('deleteItem');
}
editItem(){
console.debug('editItem');
}
}
Using Typescript 1.6.2 this compiles into:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { inject, bindable } from 'aurelia-framework';
import { HttpClient } from 'aurelia-http-client';
export let App = class {
constructor(http) {
this.http = http;
}
getTruckLoadData($event) {
return new Promise((resolve, reject) => resolve({
data: this.http.get('localhost/truckload'),
count: 2
}));
}
;
addItem() {
console.debug('addItem');
}
deleteItem() {
console.debug('deleteItem');
}
editItem() {
console.debug('editItem');
}
};
__decorate([
bindable,
__metadata('design:type', Object)
], App.prototype, "SelectedRow");
App = __decorate([
inject(HttpClient),
__metadata('design:paramtypes', [HttpClient])
], App);
//# sourceMappingURL=app.js.map
The import statements in the javascript file report: Cannot resolve file ...
The Typescript compiler finds the import files just fine via a jspm config.js mapping. Why does the javascript version have a problem?
Please sign in to leave a comment.
It seem to a problem in last EAP build
I to get this error everywhere in js imports "can not resolve directory"
If you mark the directory (relative to wich files are resolved) as Resource Root the rror is gone
But This is not right I think, or this sould be optional, because I can not mark node_modules as recource root as I mark it exluded (to get rid of indexing and search)