The error:
`Internal error during “Functions bundling”
Error message
RangeError: Maximum call stack size exceeded
Error location
During Functions bundling
at Array.filter ()
at shouldTranspile (/opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/nft/es_modules.js:65:38)
at /opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/nft/es_modules.js:74:67
at Array.every ()
at shouldTranspile (/opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/nft/es_modules.js:74:45)
at /opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/nft/es_modules.js:74:67
at Array.every ()
at shouldTranspile (/opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/nft/es_modules.js:74:45)
at /opt/homebrew/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/nft/es_modules.js:74:67
at Array.every ()
I am experiencing the same errors with my nextjs project, all of a sudden. Was working fine until today. I did not change much. Attached is the full log. I have doubled checked my code for recursive functions and double imports etc. That is not the issue.
Sure, how can I share it with you in the best possible way? the github repo should be easy to clone and run (npm run dev or npm run build + npm run start in the root folder). GitHub - aleksati/aleksati: my site
Looks like one of your custom functions from netlify/functions folder is either not supported, or triggering a bug on our end. I’ll pass this to devs for feedback.
Yes, I just discovered that the “netlify/functions” folder was pointing to my other “functions” folder located in the root of my nextjs project. That was the problem. They are folder with totally different kind of “functions”.
I set the netlify functions folder back to default (“not set”). Now it seems to work fine again.
I’m stuck on this exact issue and have repo to demonstrate the issue.
For reference, here is a failed deploy for that repo: Netlify App
This is derived from another project which was building and deploying just fine a day or so ago. But I changed something without realizing it and now seem unable to restore the working configuration. But unless I’m missing something, this configuration should work. But the netlify build step locally and on netlify.com shows that something’s amiss.
Not sure what you’re trying, @jneander. You don’t need to use tsc to build Netlify Functions. Just leave the .ts file in your repo and Netlify would bundle that as a function.
If I need to have specific build steps, I’ll need to retain control over the build process and not delegate that to Netlify. This is a simplified example just to show that something is amiss. It leaves out more of the use case.
After posting this, I tried different configurations and hit the same issue multiple ways, including without using TypeScript. Only when I gave CommonJS to Netlify did it finally work mostly as expected. This issue was resolved, which seems to point to how Netlify’s build step is handling ES Modules as the cause. For other reasons, I still can’t get this deployed successfully.
We don’t support processed source files being sent to us for Functions bundling. For us, the expected use case is to place your source files in the repo and allow us to bundle those. You can choose to do it some other way, but we can’t assure it would work fine, or provide support with that.
If you wish to share a reproduction without you doing the processing, I’m happy to check and give it a go.
I believe that Hrishikesh was not saying you couldn’t name your npm script build, but that you shouldn’t pre-process your input files, you should just submit them as uncompiled and let us bundle them for you.
Is there something amiss with that last version of the repo that I pushed? It has no build step prior to Netlify’s process, and continues to fail at the bundling.