RangeError: Maximum call stack size exceeded when using esbuild-node-externals plugin
See original GitHub issueWhen using esbuild-node-externals plugin there is a recursive function that runs out of stack space.
esbuild-plugins.js
const graphqlLoaderPlugin = require('@luckycatfactory/esbuild-graphql-loader').default;
const { nodeExternalsPlugin } = require('esbuild-node-externals');
module.exports = [graphqlLoaderPlugin(), nodeExternalsPlugin()];
esbuild config
serverless.yml
esbuild:
packager: yarn
plugins: ./esbuild-plugins.js
minify: false
keepNames: true
sourcemap: true
sourcesContent: false
exclude:
- mysql
Serverless: Packing external modules: @aws-sdk/client-apigatewaymanagementapi@^3.33.0, @aws-sdk/client-dynamodb@^3.31.0, @aws-sdk/util-dynamodb@^3.33.0, @lambda-middleware/cors@^2.0.0, @sendgrid/client@^7.4.6, @sendgrid/mail@^7.4.6, JSONStream@^1.3.5, airtable@^0.10.1, apollo-server-lambda@^2.25.2, graphql@^15.5.3, apollo-server-plugin-base@^0.13.0, aws-lambda-graphql@1.0.0-alpha.23, graphql-subscriptions@^1.2.1, axios@^0.21.4, axios-logger@^2.5.0, compare-versions@^3.6.0, cors@^2.8.5, dataloader@^2.0.0, express@^4.17.1, fp-ts@^2.11.2, google-libphonenumber@^3.2.22, graphql-depth-limit@^1.1.0, graphql-request@^3.4.0, graphql-scalars@^1.10.1, ini@^1.3, io-ts@^2.2.16, io-ts-promise@^2.0.2, jsonwebtoken@^8.5.1, jwk-to-pem@^2.0.5, jwks-rsa@^2.0.4, knex@^0.95.11, knex-stringcase@^1.4.5, luxon@^2.0.2, mysql2@^2.3.0, parse-duration@^1.0.0, qs@^6.10.1, serverless-http@^2.7.0, source-map-support@^0.5.20, states-us@^1.0.1, timezones-list@^3.0.1, twilio@^3.68.0, uuid@^8.3.2, vm2@^3.9.3
Range Error ---------------------------------------------
RangeError: Maximum call stack size exceeded
at flatDep (/home/nhoize/vori/voyaapollolambda/node_modules/serverless-esbuild/dist/helper.js:57:17)
at /home/nhoize/vori/voyaapollolambda/node_modules/serverless-esbuild/dist/helper.js:68:75
at Array.reduce (<anonymous>)
at flatDep (/home/nhoize/vori/voyaapollolambda/node_modules/serverless-esbuild/dist/helper.js:63:33)
at /home/nhoize/vori/voyaapollolambda/node_modules/serverless-esbuild/dist/helper.js:68:75
at Array.reduce (<anonymous>)
at flatDep (/home/nhoize/vori/voyaapollolambda/node_modules/serverless-esbuild/dist/helper.js:63:33)
at /home/nhoize/vori/voyaapollolambda/node_modules/serverless-esbuild/dist/helper.js:68:75
at Array.reduce (<anonymous>)
…repeats for another 14,000 lines
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Maximum call stack size exceeded when using esbuild-node ...
When using esbuild-node-externals plugin there is a recursive function that runs out of stack space. esbuild-plugins.js
Read more >Maximum call stack size exceeded on npm install
Maximum call stack size exceeded on npm install · 1. First of all, I'd check the github issues link for similar problems, and...
Read more >[BUG] npm audit fix error: Maximum call stack size exceeded
Assuming that "Maximum call stack size exceeded" happens because there is too much to do, it may be that the reproducer is really...
Read more >Node.js Agent version 3.x - Elastic
Avoid a possible RangeError: Maximum call stack size exceeded in Span timer handler for exceedingly deep Span trees. (#2939); Fix instrumentation of (very ......
Read more >crim-adnotare-psc - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages ... fork-ts-checker-webpack-plugin ... RangeError: Maximum call stack size exceeded ...
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 FreeTop 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
Top GitHub Comments
yes I edited the stacktrace XXX is not the version in package.json =).
Good catch, when I switch the lines it works!
yes sure
StackTrace
I removed all circular dependencies detected by tools sush as magde or dpdm and everything is clean.
Serverless.yml