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
How would one go about setting the data in the request session data?
Full stack trace:
internal/process/promises.js:213
triggerUncaughtException(err, true /* fromPromise */);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Array
at new NodeError (internal/errors.js:322:7)
at Socket.Writable.write (internal/streams/writable.js:285:13)
at RedisSocket.writeCommand (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/@node-redis/client/dist/lib/client/socket.js:57:130)
at Commander._RedisClient_tick (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/@node-redis/client/dist/lib/client/index.js:421:64)
at Commander._RedisClient_sendCommand (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/@node-redis/client/dist/lib/client/index.js:402:82)
at Commander.commandsExecutor (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/@node-redis/client/dist/lib/client/index.js:160:154)
at Commander.BaseClass.<computed> [as set] (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/@node-redis/client/dist/lib/commander.js:8:29)
at RedisStore.set (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/connect-redis/lib/connect-redis.js:65:21)
at Session.save (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/express-session/session/session.js:72:25)
at Session.save (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/express-session/index.js:406:15)
at ServerResponse.end (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/express-session/index.js:335:21)
at ServerResponse.send (/Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/express/lib/response.js:221:10)
at /Users/oleg/Programming/tutorials/lireddit-follow/server/node_modules/apollo-server-express/dist/ApolloServer.js:89:25 {
code: 'ERR_INVALID_ARG_TYPE'
}
The text was updated successfully, but these errors were encountered:
just ran into this issue and my solution was to switch to ioredis from redis, based on my reading there seems to be some sort of collision of types in redis v4.
additionally, ioredis uses new redis instead of redis.redisClient.
Running into this issue where the server will crash when setting
req.session.userId = user.id
:I've already set my
types.ts
file to include the workaround for the versions of express-session^1.17.4
:How would one go about setting the data in the request session data?
Full stack trace:
The text was updated successfully, but these errors were encountered: