I want to pass the HttpError through an action and so I do the following:
export const someFail = createAction(
'[Feature] Some fail',
props<HttpErrorResponse>(),
);
... however it doesn't compile:


props accept HttpErrorResponse.
Ngrx 10, Angular 11.
[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
@dev054
HttpErrorResponse extends HttpResponseBase:
export abstract class HttpResponseBase {
/**
* Type of the response, narrowed to either the full response or the header.
*/
readonly type: HttpEventType.Response | HttpEventType.ResponseHeader;
}
However, HttpResponseBase contains the type property, which is not allowed.
Try this:
const a = createAction('a', props<{ error: HttpErrorResponse }>());
Thanks @markostanimirovic 馃憤
I wonder if we could make it clearer in the docs, e.g. don't do this (code example) and do with a prop name instead (code example).
Fyi, I'm going to steal this and going to create a lint rule for this add eslint-plugin-ngrx.
@dev054 do you think it would be more clear if we would change the error message?
If so, do you have a proposition?
Does this succinctly describe the problem?
interface with "type" property not allowed because it conflicts with the action's type
The docsite could also note the list of illegal generic arguments for props/ the type of the creator function argument.
Most helpful comment
Thanks @markostanimirovic 馃憤
I wonder if we could make it clearer in the docs, e.g. don't do this (code example) and do with a prop name instead (code example).