rollup/rollup

RangeError: Maximum call stack size exceeded

danush-basky opened this issue · 6 comments

Hey there! If you need help or tech support then this is not the place to ask. Please head to the Rollup Discord instead or post a question to https://stackoverflow.com/questions/tagged/rollupjs.

If you arrived here because you think Rollup's documentation is unclear, insufficient or wrong, please consider creating an issue for the documentation instead.

Getting the below error on npm run build while building docker image. Able to build successfully on host machine. Using Vite.

RangeError: Maximum call stack size exceeded
at convertNodeList (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:2064:34)
at classBody (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:1142:22)
at convertNode (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:2057:12)
at importDefaultSpecifier (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:1484:23)
at convertNode (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:2057:12)
at convertNodeList (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:2064:34)
at classBody (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:1142:22)
at convertNode (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:2057:12)
at importDefaultSpecifier (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:1484:23)
at convertNode (file:///app/node_modules/rollup/dist/es/shared/parseAst.js:2057:12)
building at STEP "RUN npm run build": while running runtime: exit status 1

I fixed this by downgrading @rollup/rollup-linux-x64-gnu to version 4.17.1.

Sorry I missed this one. If this problem still persists, any kind of reproduction would be more than welcome. This looks like it is caused by a module that cannot be parsed correctly, so we would need to see the code of the module in question.

Impossible for me to tell, sorry. Only guidance I can provide is the following:

  • Failure running vitest - vitest/1.1.3 linux-x64 node-v20.12.1
  • Linux with clang
  • npm version 10.5.0
  • Project uses typescript - tsc Version 5.3.3

That does not help at all, unfortunately. What we need is the source code of a module that does not parse. If your sources are JavaScript, you could paste sources as "main.js" in the REPL and see if the error triggers there. This can be done file-by-file, no need for imported files to be present.
To limit your search, you could also add a simple plugin that logs whenever we start with a module and whenever parsing has happened:

{
  name: 'log-modules',
  transform(_, id) {
    console.log('Before parsing of', id);
  },
  moduleParsed({id}) {
    console.log('Parsed', id);
  }
}

then you only need to check the modules where 'Before parsing of' is not matched by a 'Parsed' log.