I am trying to deploy my node application in rander web hosting. but each time the deployment process start, i get this error that says
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
src/@types/session.d.ts(3,16): error TS2665: Invalid module name in augmentation. Module 'express-session' resolves to an untyped module at '/opt/render/project/src/node_modules/express-session/index.js', which cannot be augmented.
i have a custom type declaring of some parameter since am using typescript and i can’t find a typing for them
below is the type declaration src/@types/session.d.ts
import session from "express-session";
declare module "express-session" {
interface SessionData {
userId: any;
amount: any;
code: any;
historyRecords: any;
plan: any;
plan_id: any;
withdrawalRecord?: any;
}
}
this works perfectly well on my local but on deployment on rander, it keeps throwing the error.
this is my tsConfig file
{
"compilerOptions": {
"allowJs": true,
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"typeRoots": [
"./node_modules/@types",
"./@types",
],
"resolveJsonModule": true,
},
"exclude": ["node_modules", "dist/**/*"],
"lib": ["es2015"],
}
i have tried everything possible but am still getting the error. i already installed type definition for “express-session” but the problem still persist.. can anyone please help me out on this.. thank you in advance