Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Asset should be uploaded successfully
Environment (please complete the following information):
Additional context
I'm using @vendure/asset-server-plugin with default options from Vendure cli.
stack trace:
[run:server] RangeError: Maximum call stack size exceeded
[run:server] at ReadStream.deprecated [as open] (internal/util.js:74:22)
[run:server] at ReadStream.open (/Users/villesaukkonen/Code/webshop-vendure/node_modules/fs-capacitor/lib/index.js:90:11)
[run:server] at _openReadFs (internal/fs/streams.js:138:12)
[run:server] at ReadStream.<anonymous> (internal/fs/streams.js:131:3)
[run:server] at ReadStream.deprecated [as open] (internal/util.js:89:15)
[run:server] at ReadStream.open (/Users/villesaukkonen/Code/webshop-vendure/node_modules/fs-capacitor/lib/index.js:90:11)
[run:server] at _openReadFs (internal/fs/streams.js:138:12)
[run:server] at ReadStream.<anonymous> (internal/fs/streams.js:131:3)
[run:server] at ReadStream.deprecated [as open] (internal/util.js:89:15)
[run:server] at ReadStream.open (/Users/villesaukkonen/Code/webshop-vendure/node_modules/fs-capacitor/lib/index.js:90:11)
error Command failed with exit code 1.
This is an issue with Apollo Server, see https://github.com/apollographql/apollo-server/issues/3508
TL;DR: Apollo Server internally uses an older version of the graphql-upload package which does not support Node v13+. They plan to remove that lib in Apollo Server v3 but will not update the dependency in v2 because that would be a breaking change.
Kinda silly but there are potential work-arounds listed in that thread. Or just downgrade to Node v12.x for now.
(related: #458)
Thanks, downgrading node did the trick! BTW, might be good to mention in the documentation that asset plugin only supports node 12.x. Now it says all the new nodes are supported.
With node 14.x following solution worked:
"resolutions": {
"**/**/fs-capacitor": "^6.2.0",
"**/graphql-upload": "^11.0.0"
}
Most helpful comment
Thanks, downgrading node did the trick! BTW, might be good to mention in the documentation that asset plugin only supports node 12.x. Now it says all the new nodes are supported.