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

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

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 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!