[Bug] Maximum call stack size exceeded
See original GitHub issue- Insomnia Version: insomnia-importers 2.0.14
- Node Version: 11.6.0
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:
- Created 5 years ago
- Reactions:2
- Comments:48 (12 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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”.
Any big config file will do.
P.S. Same problem with swagger json. P.S.P.S. I have 29k line json for eg.