Not compiling/reading files correctly
- [x ] bug report
- [ ] feature request
Versions.
@angular/cli: 1.0.0 node: 7.7.4 os: darwin x64 @angular/common: 4.0.0 @angular/compiler: 4.0.0 @angular/core: 4.0.0 @angular/forms: 4.0.0 @angular/http: 4.0.0 @angular/platform-browser: 4.0.0 @angular/platform-browser-dynamic: 4.0.0 @angular/router: 4.0.0 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.0
When i modify and save my files, i see Angular-cli generating the chunks again - However its not reading the files content and is still giving errors. I have to exit and re-run ng serve before it stops giving errors.
For instance, i have an interface:
export interface ISignup {
email: string;
password: string;
companyName: string;
companyRole: string;
firstName: string;
lastName: string;
phone: string;
country: string;
}
Which i renamed to SignupInterface but the compiler is still giving error:
Module '"/app/signup/signup.model"' has no exported member 'SignupInterface'.
After exiting and re-running ng serve the problem gets fixed but its really annoying having to change properties/class/interface names and then re-running compiler
Heya, does this only happen on interfaces?
@filipesilva it happens for classes aswell.
Renaming a class doesn't register unless i restart the CLI.
Same happens to me with ng test (4.0.0-rc.5)
@hassanasad I was not able to replicate it on classes. But I can confirm it only happens in the case of interfaces so seems to be an issue with interfaces. On running ng serve it only picks the interfaces already defined. Making any consecutive change in the interface doesn't pick up the changes. Shows below error.
ERROR in /Users/sumitarora/workspace/open-source/temp/aa/src/app/app.component.ts (17,5): Type '{ email: string; p2: string; }' is not assignable to type 'Signup'.
Object literal may only specify known properties, and 'p2' does not exist in type 'Signup'.
Changing password to p2 in the interface.
export interface Signup {
email: string;
password: string;
}
@sumitarora that is weird - its same for me on classes and interfaces both. Perhaps might be because i have both in the same file which i am testing with?
@filipesilva, @sumitarora Ah - it happens for classes as well IF the file contains an interface.
For instance:
export class SignupModel {
constructor(
email: string,
password: string,
companyName: string,
companyRole: string,
firstName: string,
lastName: string,
phone: string,
country: string,
) { }
}
export interface SignupInterface {
email: string;
password: string;
companyName: string;
companyRole: string;
firstName: string;
lastName: string;
phone: string;
country: string;
}
I'm having the same issues. I previously had the issues in beta 30, but got around it by downgrading @ngtools/webpack to version 1.2.4
Changes to html files will be reflected in the browser after rebundling. Changes to .ts files seem to trigger a rebundle, however do not get reflected in the browser until a new ng serve is run
@angular/cli: 1.0.0 node: 7.7.4 npm: 4.3.0 os: windows 10 "@angular/common": "4.0.0", "@angular/compiler": "4.0.0", "@angular/core": "4.0.0", "@angular/forms": "4.0.0", "@angular/http": "4.0.0", "@angular/platform-browser": "4.0.0", "@angular/platform-browser-dynamic": "4.0.0", "@angular/router": "4.0.0",
"@angular/cli": "1.0.0", "@angular/compiler-cli": "4.0.0",
I'm having this issue with custom typings, even when it's not in separate files. I was trying to add custom matchers to Jasmine, and it's failing. Here's a minimal reproducible example:
In a fresh install ([email protected], [email protected], typescript@~2.2.0), all I've changed is app.component.spec.ts:
import { async } from '@angular/core/testing';
import { AppComponent } from './app.component';
declare namespace jasmine {
interface Matchers {
toUseCustomMatcher(): boolean;
}
}
describe('AppComponent', () => {
beforeEach(() => {
jasmine.addMatchers({
toUseCustomMatcher: () => ({ compare: (expected) => ({ pass: true }) })
});
});
it('should foo', async(() => {
expect(null).toUseCustomMatcher();
}));
});
This will pass on the first run, and on all subsequent runs throws error:
ERROR in /myworkspace/src/app/app.component.spec.ts (18,18): Property 'toUseCustomMatcher' does not exist on type 'Matchers'.
If anyone has a workaround other than --single-run, I'd be very grateful for input.
+1
Same issues. "@angular/cli": "1.4.1"
Still seeing this in "@angular/cli": "1.4.2"
still in "@angular/cli": "1.4.5",
+1 I have the same issue with class based typing's and the class doesn't contain any interfaces.
Ok, I've changed all the classes to interfaces, seems to be working now. Still using older version of cli @angular/cli: 1.2.6
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.