xmlobj.Contents.forEach is not a function
See original GitHub issueFor some reason distribution version of the package does not wrap all xmlobj.Contents
accesses with toArray
. I checked source code, and it seems everything is fine there, but for some reason in the node_modules/minio/dist/main/xml-parsers.js
first access of the xmlobj.Contents
(line 387) is not wrapped with toArray
.
I might be missing something obvious here.
How to reproduce
I’m using express-middleware-minio
package, and when I try listing all files in the bucket, I get that error. I’m pretty sure, it’s not related to that package.
I’ve tried to create an empty project, install minio with:
$ yarn add minio
and check dist
directory of the package:
$ cat -n node_modules/minio/dist/main/xml-parsers.js | grep xmlobj.Contents
Output was:
386 if (xmlobj.Contents) {
387 xmlobj.Contents.forEach(function (content) {
436 if (xmlobj.Contents) {
437 toArray(xmlobj.Contents).forEach(function (content) {
481 if (xmlobj.Contents) {
482 toArray(xmlobj.Contents).forEach(function (content) {
As you can see, first access of the xmlobj.Contents
is not wrapped with toArray
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Developers - xmlobj.Contents.forEach is not a function -
Contents accesses with toArray . I checked source code, and it seems everything is fine there, but for some reason in the node_modules/minio/dist/main/xml- ......
Read more >forEach is not a function error with JavaScript array
First option: invoke forEach indirectly. The parent.children is an Array like object. Use the following solution: const parent = this.el.
Read more >Solved: Re: Can we convert object into XML inside Javascip...
This forEach invokes a function one time for each of the ID's in the array. ... var xmlobj = new XML(response.content); var json ......
Read more >SimpleXML Functions - Manual - PHP
SimpleXML Functions ¶. Table of Contents ¶ ... foreach ( (array) $xmlObject as $index => $node ) ... will silently NOT output any...
Read more >TypeError: foreach is not a function in JavaScript - Java2Blog
Table of Contents [hide]. Use Object.keys() or Object.values() or Object.entries(); Use Arrays.from(). TypeError: .foreach is not a function occurs when we ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
it works, thank you very much @prakashsvmx , you saved my day.
I think issues should not be closed before the release. The same bug was reported multiple times, because we can’t find the original issue. When I find the original issue, which is closed, I assume my bug report is different, because it still exists in the latest version.