Upload error: Invalid state: chunk ArrayBuffer is zero-length or detached

I’m encountering an upload failure with the following error:

There was a problem with your upload

Invalid state: chunk ArrayBuffer is zero-length or detached

To investigate the issue, examine this stack trace:
  at new NodeError (node:internal/errors:393)
  at enqueue (node:internal/webstreams/readablestream:1122)
  at pull (fetch-blob/index.js:161)
    chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value)

Has anyone encountered this error when submitting the app?

Thanks

1 Like

What are you doing when getting this error? npx shop-minis submit?

@Shane_Stratton Yes, I’m getting this error when running npx shop-minis submit.

@Shane_Stratton I don’t use any file upload component in my app, but I’m still getting this error. Do you have any idea what might be causing it?

Hi @davidhoffman-shopify, could you help me with this issue? I’m getting an upload error during npx shop-minis submit and would appreciate your insight.

Make sure you have your CLI upgraded npx shop-minis upgrade and in which step you get this error after you submit? Share the full logs npx shop-minis submit --verbose

@adham7ibrahim Thank you. I’ve already upgraded my CLI, but I’m still seeing this error.

you’re welcome, try to make a new mini and move the code and see if it works

@Zination try to remove the .minis-cache folder and resubmit. Some of the submission issues cleared up for users in the past.

No, sorry! I think I’d just be speculating without logs and I haven’t seen it. Looks like such a low-level error though? Network or node version or some random corrupt file in the build?

I’d just be spamming “fresh” approaches like cleaning caches or using fresh mini project. Keep us posted!

Hey! I’ve not seen this before - would you mind sending more information from the template and I can try to investigate: Shop Minis Support Template - Required for all issue reports

Hey @davidhoffman-shopify

I delete node modules and build again
Once that was done, I resubmitted but no luck

so as per your instructions, I ran npm shop-minis info

Here is the result:

✔ System information loaded

System:
OS: macOS 15.7.1
CPU: (8) arm64 Apple M2
Memory: 136.14 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.8 - /Users/arhumsharif/.nvm/versions/node/v18.20.8/bin/node
npm: 10.8.2 - /Users/arhumsharif/.nvm/versions/node/v18.20.8/bin/npm
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild

Packages:

/shop-minis-cli: 0.1.2

/shop-minis-react: 0.4.17
react: 18.2.0

@hanwar I deleted the node_modules folder and rebuilt the project. Then I resubmitted it, and it worked for me.

Hi, I deleted the node_modules folder and rebuilt the project. Then I resubmitted it, and it worked for me.

@hanwar and you are getting the same Invalid state: chunk ArrayBuffer is zero-length or detached error?

I tried again today and it worked. Weird! same method didn’t work before today.

1 Like

Ok - good to hear it’s working now - Talking to the team today we shipped a change that might have fixed this but we have not been able to replicate this error internally so if anyone else ever sees this please give as many details as possible so we can try to track it down.

1 Like