express-request-id
express-request-id copied to clipboard
Fix TypeScript error caused by duplicate Request identifiers
Only interface
declarations can be merged and using type
results in the below error.
node_modules/@types/express-serve-static-core/index.d.ts:19:19 - error TS2300: Duplicate identifier 'Request'.
19 interface Request {}
~~~~~~~
node_modules/express-request-id/types.d.ts:7:8
7 type Request = {
~~~~~~~
'Request' was also declared here.
node_modules/express-request-id/types.d.ts:7:8 - error TS2300: Duplicate identifier 'Request'.
7 type Request = {
~~~~~~~
node_modules/@types/express-serve-static-core/index.d.ts:19:19
19 interface Request {}
~~~~~~~
'Request' was also declared here.
See https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces
Is there a work-around for this issue or is express-request-id
currently not compatible with a TypeScript project?
You can use old version, 1.x works IIRC.
I had the same problem, glad to see that a PR is open to fix this.
Hey, @floatdrop, any idea about when this is gonna be merged? :) Thanks!