I am working with the aurelia-typescript-skeleton
as the base for my new project. I tried adding a new hello.ts
file in src
folder
export class Hello {
sayHello(name:string) : string {
return 'Hello ' + name;
}
}
and referenced it in another file in the same folder as below
import {Hello} from './hello';
export class Users {
constructor() {
console.log(new Hello().sayHello('Test'));
}
}
Both the files are at the same folder level. Everything works fine when I build for the first time. When I make any subsequent changes on the users.ts
file, the gulp-typescript
compilation keeps failing with an error I am unable to understand. The error from the typescript compiler is
> Starting 'build-system'...
> src\users.ts(4,21): error TS2307: Cannot find module 'hello'.
> TypeScript: 1 semantic error
> TypeScript: emit succeeded (with errors)
> Finished 'build-system' after 950 ms
Whenever i do a fresh gulp watch
, there are no errors. The error appears when I edit/change the users.ts
file. Can anyone help me understand this error? It must be something basic...
I'm on Windows 7 environment, and I get this error on 2 machines.
UPDATE:
Here is the repo to reproduce the problem. Steps to reproduce:
- Clone the repo, install all
npm
andjspm
dependencies. - Run
gulp watch
-> no errors occur for me - Change
users.ts
file and save -> the error occurs.
UPDATE2:
Adding a clean
step before build-system
helps to avoid the problem. Here is the link to commit. Still I'm not sure about the actual reason of the problem at first hand.