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

207
Visualizações
CoinGecko API: Can't resolve 'https' and Can't resolve 'querystring'

I'm just getting started with the CoinGecko API but the first call I made to /ping. It gives me the error Module not found: Error: Can't resolve 'https'. Any idea why is this happening? I'm doing it with react, here is the code:

project/src/App.js

import { useEffect } from 'react';
import axios from 'axios';
// import CoinGecko from 'coingecko-api/lib/CoinGecko';
const CoinGecko = require("coingecko-api");




function App() {  
  
  useEffect(() => {
    const CoinGeckoClient = new CoinGecko();
    
    async function pingAPI(){
      const response = await CoinGeckoClient.ping();
      console.log(response)
      return response
    
    }

    pingAPI()

  }, [])
  
  return (
    <div>Hello world</div>
  )
}

export default App;

Here is the full stacktrace:

Compiled with problems:X

ERROR in ./node_modules/coingecko-api/lib/CoinGecko.js 3:14-30

Module not found: Error: Can't resolve 'https' in '/Users/romunoz/Documents/code/javascript/cryptoapp/node_modules/coingecko-api/lib'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
    - install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "https": false }


ERROR in ./node_modules/coingecko-api/lib/CoinGecko.js 5:20-42

Module not found: Error: Can't resolve 'querystring' in '/Users/romunoz/Documents/code/javascript/cryptoapp/node_modules/coingecko-api/lib'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
    - add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
    - install 'querystring-es3'
If you don't want to include a polyfill, you can use an empty module like this:
    resolve.fallback: { "querystring": false }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

https is a nodejs module so no, you need a backend for this.

If you don't want to have a backend then you don't need a wrapper and just use the api endpoints

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