Vendure: Asset upload fails

Created on 8 Sep 2020  路  3Comments  路  Source: vendure-ecommerce/vendure

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to admin asset page
  2. try to upload an asset
  3. See error: "Could not connect to the Vendure server at auto:auto" (and see the stack trace in terminal)

Expected behavior
Asset should be uploaded successfully

Environment (please complete the following information):

  • @vendure/core version: 0.15.0
  • Nodejs version 14.9.0
  • Database (mysql/postgres etc): postgres 12.4

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.

bug 馃悰

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.

All 3 comments

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"
  }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefanvanherwijnen picture stefanvanherwijnen  路  5Comments

michaelbromley picture michaelbromley  路  5Comments

hendrik-advantitge picture hendrik-advantitge  路  6Comments

mattgills picture mattgills  路  4Comments

chladog picture chladog  路  7Comments