You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi,
I am trying to connect express session to my native mongo store by reusing the existing mongo client instance, but no matter how much i try, it never seem to work at all.
when i run my app , i always end up with this error
Assertion failed: You must provide either mongoUrl|clientPromise|client in options
Error: Cannot init client. Please provide correct options
at new MongoStore (D:\code\clients\development\Trendy-Toys\server\node_modules\connect-mongo\src\lib\MongoStore.ts:196:13)
at Function.create (D:\code\clients\development\Trendy-Toys\server\node_modules\connect-mongo\src\lib\MongoStore.ts:214:12)
at Object. (D:\code\clients\development\Trendy-Toys\server\src\config\sessionStore.ts:11:33)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module.m._compile (D:\code\clients\development\Trendy-Toys\server\node_modules\ts-node\src\index.ts:1371:23)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.require.extensions. [as .ts] (D:\code\clients\development\Trendy-Toys\server\node_modules\ts-node\src\index.ts:1374:12)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
hi,
I am trying to connect express session to my native mongo store by reusing the existing mongo client instance, but no matter how much i try, it never seem to work at all.
when i run my app , i always end up with this error
Assertion failed: You must provide either mongoUrl|clientPromise|client in options
Error: Cannot init client. Please provide correct options
at new MongoStore (D:\code\clients\development\Trendy-Toys\server\node_modules\connect-mongo\src\lib\MongoStore.ts:196:13)
at Function.create (D:\code\clients\development\Trendy-Toys\server\node_modules\connect-mongo\src\lib\MongoStore.ts:214:12)
at Object. (D:\code\clients\development\Trendy-Toys\server\src\config\sessionStore.ts:11:33)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module.m._compile (D:\code\clients\development\Trendy-Toys\server\node_modules\ts-node\src\index.ts:1371:23)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.require.extensions. [as .ts] (D:\code\clients\development\Trendy-Toys\server\node_modules\ts-node\src\index.ts:1374:12)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
This my express session in app.js file:
This is sessionStore file:
I am importing my mongodb instance from a seperate file
versions:
I'd apprecite if anyone can help me with this issue. Thanks
The text was updated successfully, but these errors were encountered: