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
After upgrading to next 11.1.0, I started getting this error:
error-unhandledRejection: TypeError[ERR_INVALID_ARG_TYPE]: The"string"argumentmustbeoftypestringoraninstanceofBufferorArrayBuffer.ReceivedundefinedatFunction.byteLength(buffer.js:727:11)atServerResponse.apiRes.end(C:\path-to-project\node_modules\next\dist\server\api-utils.js:73:41)atwriteend(C:\path-to-project\node_modules\express-session\index.js:262:22)atontouch(C:\path-to-project\node_modules\express-session\index.js:353:11)
at C:\path-to-project\node_modules\connect-mongo\build\main\lib\MongoStore.js:339:24atrunMicrotasks(<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {code: 'ERR_INVALID_ARG_TYPE'
The code below found in server/api-utils.ts is not accounting for the possibility of the first parameter args[0] being undefined. Since the if condition does not cover such scenario, calling Buffer.byteLength with undefined will result in an error because args[0] type is not a supported type (supported types are: String, Buffer, TypedArray, DataView, ArrayBuffer).
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 27, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
11.1.0
What version of Node.js are you using?
14.17.5
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
Vercel
Describe the Bug
After upgrading to
next
11.1.0, I started getting this error:The code below found in
server/api-utils.ts
is not accounting for the possibility of the first parameterargs[0]
beingundefined
. Since the if condition does not cover such scenario, callingBuffer.byteLength
withundefined
will result in an error becauseargs[0]
type is not a supported type (supported types are:String
,Buffer
,TypedArray
,DataView
,ArrayBuffer
).Expected Behavior
No error should happen
To Reproduce
I was able to reproduce this in my app in development that uses:
next
11.1.0express-session
connect-mongo
session storepassport
next-connect
After logging in and navigating around.
With
next
11.0.1, this error does not occur.The text was updated successfully, but these errors were encountered: