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

144
Visualizações
Discord login on my website is not working. Why?

I want to implement a Discord login on a website. But I have a few issues. When I start the application with node oauth.js in the terminal, no error popped up. But then, when I click on authorize on the Discord website, the following error pops up:

 TypeError: fetch is not a function
    at ...\oauth.js:49:5
    at Layer.handle [as handle_request] (...\node_modules\express\lib\router\layer.js:95:5)
    at next (...\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (...\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (...\node_modules\express\lib\router\layer.js:95:5)
    at ...\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (...\node_modules\express\lib\router\index.js:335:12)
    at next (...\node_modules\express\lib\router\index.js:275:10)
    at ...\node_modules\body-parser\lib\read.js:130:5
    at invokeCallback (...\node_modules\raw-body\index.js:224:16)

I can't find the error in my code... It's something to do with fetch

My code

Any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

From looking at the fiddle, I can't see any problem except the way you have formatted your fetch import.

const fetch = require('node-fetch');

Try something like that instead of importing it.

about 4 years ago · Juan Pablo Isaza Relatório
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