I followed getting-started.md but it yields a broken installation. It appears that adding express-htmx-components to package.json causes TypeScript errors on express.static and other functions in the express module.
% npx ts-node server.ts
/Users/user/app/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
server.ts:6:20 - error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'RequestHandler<Response<any, Record<string, any>>>' is not assignable to parameter of type 'RequestHandlerParams'.
Type 'RequestHandler<Response<any, Record<string, any>>>' is not assignable to type 'RequestHandler'.
Types of parameters 'request' and 'req' are incompatible.
Type 'Request' is missing the following properties from type 'IncomingMessage': aborted, httpVersion, httpVersionMajor, httpVersionMinor, and 65 more.
6 app.use('/static', express.static('static'));
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/express-serve-static-core/express-serve-static-core.d.ts:38:9
38 (path: PathParams, ...handlers: RequestHandlerParams[]): T;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The last overload is declared here.
at createTSError (/Users/user/app/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/Users/user/app/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/Users/user/app/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/Users/user/app/node_modules/ts-node/src/index.ts:1433:41)
at Module.m._compile (/Users/user/app/node_modules/ts-node/src/index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Object.require.extensions.<computed> [as .ts] (/Users/user/app/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) {
diagnosticCodes: [ 2769 ]
}
I followed getting-started.md but it yields a broken installation. It appears that adding
express-htmx-components
topackage.json
causes TypeScript errors onexpress.static
and other functions in theexpress
module.package.json
:server.ts
:tsconfig.json
: