Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
Problem with Passport serializeUser function

I was making a website written in Typescript with Dashboard and the login is the Discord Oauth2.

I started my app and the Console gave me a new error:

TypeError: Cannot read properties of undefined (reading 'push')
    at Authenticator.serializeUser (/home/project/node_modules/passport/lib/authenticator.js:254:30)
    at Object.<anonymous> (/home/project/build/wbs/server/users/routes.config.js:70:30)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/project/build/wbs/server/main.js:37:41)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)

I searched the line 70 of the file routes.config.js and the line is this.

passport.serializeUser(function(user, done) {
    // @ts-ignore
    done(null, user.discordId);
});

I really don't know what to say.

Can someone help me? If more info is needed I will add it.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!