Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crawlsite.js Error: TypeError: Converting circular structure to JSON #19

Open
dspstudio opened this issue Nov 12, 2018 · 1 comment
Open

Comments

@dspstudio
Copy link

When I try to crawl with a DEPTH bigger than 2 I get this error:
Error: TypeError: Converting circular structure to JSON
line: await util.promisify(fs.writeFile)(./${OUT_DIR}/crawl.json, JSON.stringify((root), null, ' '));
if i use util.inspect, error is gone but seems like the output is invalid json.

@jensgro
Copy link

jensgro commented Jul 22, 2020

I could eliminate THAT problem bei using an alternative to JSON.stringify, as described here: https://makandracards.com/makandra/28847-dealing-with-typeerror-converting-circular-structure-to-json-on-javascript

Now I "only" have the problem, that node seems not to like the code in general, as it throws a promise-error:

(node:13544) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().

But that's another story...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants