Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda