Comments (3)
In the console in Chrome/Chromium you can see is not a parser error:
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.
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.
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)
- Feature request: jscodeshift output from arbitrary input
- Add support for semantic / tree-sitter HOT 1
- The Solidity parsers are outdated. There's a maintained alternative that should be used
- error when typescript with TSAsExpression HOT 1
- Update espree parser HOT 1
- [Feature request] Upgrade Hermes parser HOT 1
- Update Go parser with generics support
- Is Groovy Supported by astexplorer ?
- CodeMirror editor displays error on JavaScript class private fields HOT 1
- Update TypeScript version
- Unable to save snippet with empty code
- Website freezes if Java Parser is selected with JSON view tab HOT 1
- [BUG] SWC spans are broken with multi-byte offsets and accumulating offsets
- python - "Unexpected token" error on ellipsis HOT 1
- [PROJECT BUG] When executing `npm install` in the `website` directory, an error is thrown HOT 3
- [PROJECT BUG] Module not found: Error: Can't resolve '@swc/wasm-web/wasm.js' in...
- Add a parseFragment option for parse5
- [Need] Is there any way to copy the specific property in the right board HOT 1
- [build issue] Adding parsers that use nullish coalescing or optional chaining seems to break builds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astexplorer.