TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
sudo npm install -g chrome-webstore-upload-cli
added 37 packages in 5s
21 packages are looking for funding
run `npm fund` for details
dave@dave-pc:~/src/docker-media-center/config/sodarr-chrome-plugin/chrome-plugin$ npm list -g chrome-webstore-upload
/usr/local/lib
├─┬ [email protected]
│ └── [email protected]
└── [email protected]
$ chrome-webstore-upload upload --source ../chrome-extension.zip --extension-id ........ --client-id ......... --client-secret ........ --refresh-token ...... --auto-publish
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at handlePublishStatus (file:///usr/local/lib/node_modules/chrome-webstore-upload-cli/util.js:8:27)
at doAutoPublish (file:///usr/local/lib/node_modules/chrome-webstore-upload-cli/cli.js:90:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async init (file:///usr/local/lib/node_modules/chrome-webstore-upload-cli/cli.js:167:9)
at async file:///usr/local/lib/node_modules/chrome-webstore-upload-cli/cli.js:176:5
Are you using Node 18+?
Also you don't need to install chrome-webstore-upload if you use the cli version
So I think this is because the publishing is failing, but I don't handle the response correctly. It looks like status isn't set, but something like error will be.
Can you add a console.log(publishResponse) in cli.js in your global node_modules? I'd like to see what the response looks like and what the error is.
I'm running into this one as well on GitHub actions. https://github.com/kj800x/nulinks/actions/runs/7505963707/job/20436589755
Here's the log I'm getting after logging out publishResponse. Hopefully it helps! I'm gonna go dig into the mess that is the GCP website to see if I can fix my issue.
./node_modules/.bin/chrome-webstore-upload upload --source nulinks-extension.zip --extension-id gfbdcgkehhkgfehdilpmldkeihiojjak --auto-publish
⠴ Publishing{
error: {
code: 400,
message: 'Publish condition not met: You must verify your contact email before you can publish any item. Begin the verification process on the Account tab.',
errors: [ [Object] ]
}
}
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at handlePublishStatus (file:///Users/kjohnson/testing/node_modules/chrome-webstore-upload-cli/util.js:8:27)
at doAutoPublish (file:///Users/kjohnson/testing/node_modules/chrome-webstore-upload-cli/cli.js:93:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async init (file:///Users/kjohnson/testing/node_modules/chrome-webstore-upload-cli/cli.js:170:9)
at async file:///Users/kjohnson/testing/node_modules/chrome-webstore-upload-cli/cli.js:179:5
```
Oh and here's publishResponse.error.errors in case that's helpful too:
[
{
message: 'Publish condition not met: You must verify your contact email before you can publish any item. Begin the verification process on the Account tab.',
domain: 'chromewebstore.access',
reason: 'badRequest'
}
]
Thank you! So yeah the error is due to the store, but the module isn't displaying it properly because it tries to read status before checking for errors.
PR welcome to fix it.
As for the API error, you do need to take action in your own Dashboard, it's not something related to the uploader.
I see what happened. In the latest version I started using fetch instead of got. Everything works, except that got used to throw on non-200 HTTP responses, while fetch does not.
This is fixed in the current version.
https://github.com/fregante/chrome-webstore-upload/releases/tag/v3.0.3
If you installed chrome-webstore-upload-cli locally:
npm rm chrome-webstore-upload-cli chrome-webstore-upload
npm i chrome-webstore-upload-cli
If you installed chrome-webstore-upload-cli globally:
npm rm -g chrome-webstore-upload-cli chrome-webstore-upload
npm i -g chrome-webstore-upload-cli
If you're running it with npx:
npx clear-npx-cache
npx chrome-webstore-upload-cli