Code Monkey home page Code Monkey logo

Comments (7)

nwronski avatar nwronski commented on July 24, 2024

@kibtidec This one is pretty fascinating, and I am still not exactly sure why it is happening, but hopefully this helps a bit...

Using your test code I get the same error when serving index.html from my filesystem (e.g.: file:///Users/nicholas/.../index.html) but it works perfectly fine when serving the same file from a local server (e.g.: localhost:3000/index.html). I am not sure if there is some kind of stack size limit for scripts served from the filesystem versus from HTTP/HTTPS or if there is some other cause that triggers this error.

If you are just looking to get something set up locally to start experimenting with the parser, you can clone this repository and spin up the demo code on your local machine:

git clone https://github.com/codeschool/sqlite-parser.git
cd sqlite-parser
npm install
grunt live

and then open up http://localhost:8080 in your browser.

from sqlite-parser.

kibtidec avatar kibtidec commented on July 24, 2024

@nwronski thank you for your comments and hints on how to run locally ... the thing is what I really want to do is, to call the parser from within R through its V8 package. Importing sqlite-parser.js there and calling the parser crashes my R session, so I tried to replicate this in Javascript in browser to figure out whether the problem is in R or generally.

Using from within R the version from commit 8559684 works but later versions crash.

One more comment on serving to the browser locally versa remotely: I also received the recursion error message when serving the same file through webspace at my provider, whereas it worked when served through rawgit.com - I could not see any differences in the way it is served though (e.g. HTTP headers).

from sqlite-parser.

nwronski avatar nwronski commented on July 24, 2024

@kibtidec I figured it out (kind of)! The error is introduced after uglifying the bundle. To create dist/sqlite-parser.js I was browserifying and then uglifying the source files. Testing things out locally now, the parser works fine when running the browserified bundle but then I encounter that error when using the uglified (minified) bundle. As it is now, I am also able to require the parser as a dependency in another project, such as in the parser demo, and then browserify/uglify the entire result without issues, so I am not sure what is going on here...

Until I can figure out what exactly is causing the problem, I am publishing sqlite-parser with the un-minified bundle at dist/sqlite-parser.js. Hopefully a better solution can be found since this makes the bundle ~50% larger.

Please try installing the latest release (v1.0.0-rc3) and let me know if that fixes the problem for you, thanks!

npm i sqlite-parser@beta

from sqlite-parser.

kibtidec avatar kibtidec commented on July 24, 2024

@nwronski Thank you. Did further tests:

In the browser:

  • replacing sqlite-parser.js with the newest version results in the expected behaviour
  • I can now run the sync version of sqliteParser (which previously did not work for me either)

In V8 engine of R it does not work

  • async: ReferenceError: setTimeout is not defined (as setTimeout is not part of V8 implementation)
  • sync: TypeError: Object function Object() { [native code] } has no method 'assign'

The sync version would be more natural to use in my case, but I'd be happy if either would work with the V8 engine ;-)

from sqlite-parser.

nwronski avatar nwronski commented on July 24, 2024

@kibtidec I am not super-familiar with your use case, but AFAIK Object.assign() is available in the latest versions of V8.

Are you able to use Node.js instead of V8? You'd get a setTimeout() implementation if you could switch to Node.

You might also try Babel CLI to compile sqlite-parser.js to native ES5 if you cannot upgrade to the latest V8 with Object.assign().

from sqlite-parser.

kibtidec avatar kibtidec commented on July 24, 2024

@nwronski Thank you for your comments.

In the environment I use I need to use V8 as there is an interface to V8 from within R.
I will need to dig deeper into the Object.assign. Debian and ubuntu use rather old version for libv8 and with newer versions from other repositories I was not yet able to compile the V8 library for R.

I will also check further the Babel route you were suggesting - did not know this tool yet. Maybe it is a way out. I am not too much into Javascript programming and other Node.js libraries worked well with the V8 interface. Also an earlier version of your library from couple of months ago still works nicely with V8 (so this doesn't help me, as the old version is buggy)

from sqlite-parser.

nwronski avatar nwronski commented on July 24, 2024

Feel free to reopen this issue if your problem is not resolved. There were some major changes released in v1.0.0 so it might be worth trying again using the latest release.

from sqlite-parser.

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.