question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Maximum call stack size exceeded

See original GitHub issue

Details

When running the code below with a file specification.yml which is a swagger 2.0 documentation I retrieve the error below. The original file size was ~110kb but I also reduced the size to around ~15kb but it still didn’t work. Someone else encountered this problem also but he didn’t create an issue, the comment can be found here.

const fs = require("fs");
const importers = require("insomnia-importers");

fs.readFile("specification.yml", async (err, data) => {
  if (err) throw err;

  try {
    const output = await importers.convert(data.toString());
    console.log(JSON.stringify(output.data, null, 2));
  } catch (error) {
    console.log("error", error);
  }
});
error RangeError: Maximum call stack size exceeded
    at Array.forEach (<anonymous>)
    at object (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:300:31)
    at generateParameterExample (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:332:12)
    at Object.keys.forEach.propertyName (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:301:33)
    at Array.forEach (<anonymous>)
    at object (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:300:31)
    at generateParameterExample (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:332:12)
    at Object.keys.forEach.propertyName (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:301:33)
    at Array.forEach (<anonymous>)
    at object (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:300:31)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:48 (12 by maintainers)

github_iconTop GitHub Comments

5reactions
tobylocommented, Mar 10, 2020

Just stumbled upon this myself, e.g. https://github.com/MicrosoftDocs/vsts-rest-api-specs/blob/master/specification/build/5.0/build.json will fail with “Maximum call stack size exceeded”.

5reactions
ac1dr3dcommented, Sep 4, 2019

Can you provide a sample import file that can be used to reproduce this?

Any big config file will do.

P.S. Same problem with swagger json. P.S.P.S. I have 29k line json for eg.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code. More ......
Read more >
How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >
javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found