Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
Helper function is not defined error when using Reddit API?

I'm getting a really weird error called "'scrapeSubreddit' is not defined no-undef" for this function I've created. I'm trying to use the Snoowrap API for Reddit results.

import Snoowrap from 'snoowrap';

function scrapeSubreddit(){
  const r = new Snoowrap({ 
    userAgent: 'myName',
    clientId: 'myID',
    clientSecret: 'mySecret',
  });

  const inspQuote = r.getSubreddit("quotes").getTop({time: 'week',limit:1});
  console.lop(inspQuote);
};


export default scrapeSubreddit;

Edit: I'm also additionally getting several Module not found errors, when I import this .js file into my main .js file for use. I get:

Module not found: Error: Can't resolve 'stream'

Module not found: Error: Can't resolve 'url'

Module not found: Error: Can't resolve 'querystring'

How do I solve this as well?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think that the problem is in import statement. You should import it like this :

const snoowrap = require('snoowrap');
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda