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

119
Views
Why is jsfiddle saying the reference is undefined

I'm quite new to javascript and jsfiddle. I've been able to toy around with other fiddles that I find, but setting one up myself has proved difficult.

I'm attempting to use a library from npm to get a proof of concept for how it might work. I'm not sure why my import of the module is not working with jsfiddle.

What am I missing to get my fiddle working?

  • used the resourced bar to import the unpkg script
https://unpkg.com/browse/json-query@2.2.2/index.js
  • tried using the method outlined in the package readme
var json = [...]

jsonQuery('[DisplayText]', json)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When I follow the unpkg link I see that it has requires such as:

var State = require('./lib/state')

The problem is not only can the browser not understand require, it doesn't have files like ./lib/state available.

I think the problem here is that you are trying to download the raw source, which needs to be built with something like webpack before it can be used in the browser.

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!