Giter Club home page Giter Club logo

Comments (5)

ryshu avatar ryshu commented on September 27, 2024 1

Hi,

Same issue

Log: (import in l. 4606 - var _uniq = require('underscore').uniq; )

vue.runtime.esm.js?2b0e:1888 TypeError: _uniq is not a function
    at unique (jsonpath.js?52cd:4851)
    at Handlers.subscript-child-union (jsonpath.js?52cd:4690)
    at eval (jsonpath.js?52cd:5001)
    at Array.forEach (<anonymous>)
    at eval (jsonpath.js?52cd:4998)
    at Array.forEach (<anonymous>)
    at JSONPath.nodes (jsonpath.js?52cd:4992)
    at JSONPath.query (jsonpath.js?52cd:4958)
    at fetchJsonPathData (proccess.js?25a6:41)
    at fetchData (proccess.js?25a6:24)

Can this issue been fixed ?

Regars

from jsonpath.

RoboPhred avatar RoboPhred commented on September 27, 2024

Of interest; a quick and probably non-comprehensive search only turned up _uniq as the only part of underscore being used. The bundle size could be kept to a minimum by simply bundling the lodash single-module equivalent lodash.uniqby.

(not to be confused with lodash.uniq, which does not accept the iterator function as the second argument)

from jsonpath.

alasdairhurst avatar alasdairhurst commented on September 27, 2024

Ooh, didn't see this... should have looked harder -.-. Surprised this import issue didn't get fixed for the last release...
A bit more info on a reproducable use case in this issue that i just closed: #88

The unit tests could do with being run on these bundled files.

Looks like the issue here: https://github.com/dchester/jsonpath/blob/master/Gruntfile.js#L33
Browserify is ignoring all these dependencies but the source always assumes that they exist.

Another one (seperate issue though) is "fs" which has a check for "readFileSync"
https://github.com/dchester/jsonpath/blob/master/lib/grammar.js#L101
But the actual require itself fails in the browser.
https://github.com/dchester/jsonpath/blob/master/lib/grammar.js#L2

@dchester

from jsonpath.

alexd-garcia avatar alexd-garcia commented on September 27, 2024

I am having this issue as well, any ideas on how to solve it

from jsonpath.

yash-didici avatar yash-didici commented on September 27, 2024

Please fix this issue. It would be better to remove underscore library dependency and write a function in it's place.

from jsonpath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.