Full Error Message
Unable to resolve signature of class decorator when called as an expression. Argument of type 'ClassDecoratorContext' is not assignable to parameter of type 'string | symbol | undefined'.
I created a book Module under App Module. Inside that Module I created Service File for Work. When I create a file I got this Error..?
This is My Service File
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/mon/http'
@Injectable({
providedIn:"root"
})
export class BookService {
constructor(private _http: HttpClient){ }
}
File Structure
This is My book.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/mon';
import { BookRoutingModule } from './book-routing.module';
import { HomeComponent } from './home/homeponent';
import { bookReducer } from './store/reducer/book.reducer';
import { StoreModule } from '@ngrx/store';
@NgModule({
declarations: [
HomeComponent
],
imports: [
CommonModule,
BookRoutingModule,
StoreModule.forFeature('bookReducer',bookReducer)
]
})
export class BookModule { }
Full Error Message
Unable to resolve signature of class decorator when called as an expression. Argument of type 'ClassDecoratorContext' is not assignable to parameter of type 'string | symbol | undefined'.
I created a book Module under App Module. Inside that Module I created Service File for Work. When I create a file I got this Error..?
This is My Service File
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/mon/http'
@Injectable({
providedIn:"root"
})
export class BookService {
constructor(private _http: HttpClient){ }
}
File Structure
This is My book.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/mon';
import { BookRoutingModule } from './book-routing.module';
import { HomeComponent } from './home/home.ponent';
import { bookReducer } from './store/reducer/book.reducer';
import { StoreModule } from '@ngrx/store';
@NgModule({
declarations: [
HomeComponent
],
imports: [
CommonModule,
BookRoutingModule,
StoreModule.forFeature('bookReducer',bookReducer)
]
})
export class BookModule { }
Share
Improve this question
edited Apr 26, 2023 at 11:35
Sakthivel
asked Apr 26, 2023 at 11:33
SakthivelSakthivel
631 silver badge7 bronze badges
1
- This is hard to "debug" do you have a reproduction? – timdeschryver Commented Apr 26, 2023 at 18:09
2 Answers
Reset to default 15If are using VSCode, try to restart your TypeScript Server.
Ctrl+Shift+P > TypeScript: Restart TS Server
It fixed it for me
In my case the reason was in wrong file name: MyClassts
=> MyClass.ts