Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) #76

Closed
dmzoneill opened this issue Jan 5, 2024 · 9 comments · Fixed by fregante/chrome-webstore-upload#82
Assignees

Comments

@dmzoneill
Copy link

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
@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2024
@fregante
Copy link
Owner

fregante commented Jan 5, 2024

Are you using Node 18+?

Also you don't need to install chrome-webstore-upload if you use the cli version

@fregante fregante reopened this Jan 5, 2024
@fregante
Copy link
Owner

fregante commented Jan 5, 2024

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.

@kj800x
Copy link

kj800x commented Jan 12, 2024

I'm running into this one as well on GitHub actions. https://github.com/kj800x/nulinks/actions/runs/7505963707/job/20436589755

@kj800x
Copy link

kj800x commented Jan 12, 2024

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
    ```

@kj800x
Copy link

kj800x commented Jan 12, 2024

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'
  }
]

@fregante
Copy link
Owner

fregante commented Jan 12, 2024

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.

@fregante
Copy link
Owner

As for the API error, you do need to take action in your own Dashboard, it's not something related to the uploader.

@fregante
Copy link
Owner

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.

@fregante
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants