Code Monkey home page Code Monkey logo

Comments (3)

Scipion avatar Scipion commented on June 12, 2024

In the console in Chrome/Chromium you can see is not a parser error:
rangeerror

In Firefox would just crash your tab.

the file is 58k lines code transformed in who knows how many megs object, so it's kind of understandable that the browser crashes parsing some hundreds of Megs object into a string that exceeds size limit.

Actually there is a test to test that kind of error: https://source.chromium.org/chromium/chromium/src/+/main:v8/test/mjsunit/json2.js;l=130?q=%22Invalid%20string%20length%22&ss=chromium&start=201

The error could be manage differently, but I don't think it's not a bug and can be close.

from astexplorer.

TiberiumFusion avatar TiberiumFusion commented on June 12, 2024

@Scipion

If the browser-provided JSON library is incapable of performing this task, then I suggest a more capable replacement be used instead. Perhaps the solution is as simple as a streaming JSON stringify implementation which outputs to a file stream or an array of strings under the V8 string length limit.

And if this is indeed the source of the error, then I would agree this is not a bug. It is a flaw instead.

The sample javascript I produced which produces this error in astexplorer is not especially massive. There are other webpack-reliant websites which employ monstrous, single javascript files that are even larger than that sample. Working with these files in a timely fashion requires tools like astexplorer, so it is unfortunate that this component of astexplorer cannot handle this type of javascript found in the wild.

Should this issue be closed without resolution?

  • Your comment did not magically make the JSON tab start working for me. It is still broken, right now. Therefore, this issue is not resolved, so I will not close it myself until the problem is fixed.
  • If an administrator decides this issue shall not be addressed and closed as an admission of that, then at the very least close it as not planned. This issue is documentation of an astexplorer limitation. Closing it as "resolved" without resolving anything suggests to the reader of the issues tab that the issue was a hoax or lie. I mention this because I see the administrators of this project have closed every issue as "resolved" and never used "not planned".

In case this issue is closed without resolution, does anyone here know of a graphical AST explorer tool that does not have this limitation? The others I have found through Google are orders of magnitude slower than astexplorer and nigh unusable as a result.

Non sequitur: that obfuscated console trace from the bastardized js is not a clear statement of "not a parser error". How do you know that functions Ci zg fi Ti Qj Kj yj cg fg gg Ga and gd are not part of the parser library? How am I supposed to know that as a reader? I don't have time to replicate your debugging environment and inspect each obfuscated function. Now, I will admit that the offending JSON.stringify call has a high likelihood to originate from astexplorer itself, but that hideous & unusable trace message alone is not conclusive evidence.

from astexplorer.

Scipion avatar Scipion commented on June 12, 2024

Right, if the string length limit is reached a possibility is to give the option of downloading the json file. Feel free of send a pull request with that feature :)

If you can find the time to replicate the environment I'll gladly lend you a hand.

from astexplorer.

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.