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

210
Views
API de CoinGecko: no se puede resolver 'https' y no se puede resolver 'cadena de consulta'

Apenas estoy comenzando con la API de CoinGecko, pero la primera llamada que hice a /ping . Me da el error Module not found: Error: Can't resolve 'https' . ¿Alguna idea de por qué sucede esto? Lo estoy haciendo con reaccionar, aquí está el código:

proyecto/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;

Aquí está el stacktrace completo:

 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 answers
Answer question

0

https es un módulo de nodejs, así que no, necesitas un backend para esto.

Si no desea tener un back-end, entonces no necesita un contenedor y solo use los puntos finales de API

about 4 years ago · Juan Pablo Isaza Report
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!