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: Cannot call method 'forEach' of undefined #53
Comments
Are you using the latest version? Line 594 isn't that line in the source. |
i have installed with this way |
Go to your project's directory and do: Then in your project That should give you the latest version from the package registry, using the proper install method. npm takes care of getting all the dependencies for you, and you can even check that the version is correct. It should be v1.1.6, which after installing you can see with |
Thank you for help, and now error is ./bin/channels events.js:72 |
Hmm, not sure. The only way this would happen (that I am aware of) is if the message from FSW was invalid. Can you let me see what the raw message looks like? |
Found problem on https://github.com/englercj/node-esl/blob/master/lib/esl/Connection.js#L578 |
What version of FSW are you using? Did they change the XML format recently? |
"What version of FSW are you using?" "Did they change the XML format recently?" |
can you do "npm ls --depth 0" and paste the output so I can see the version of dependencies you are using? I think |
i have tried as you asked ; with unmodified source events.js:72 when i installed xml2js 0.4.6 or 0.4.15 error is same |
That is definitely the error, what I am trying to figure out is what has changed. That line of code has been working for years, so something is different in your configuration. I'm trying determine if we need to change it to |
Today i have aded ' console.log("doc:",doc)' before https://github.com/englercj/node-esl/blob/master/lib/esl/Connection.js#L578 To Look raw message And tried to look into Sources At https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/src/mod/applications/mod_commands/mod_commands.c |
To figure Out why this is Happend |
I'm dumb, I should've just looked at the blame in the first place. So sorry about all the trouble, a new version is published that should fix your issue. |
Dear brother hello, [root@linx channels]# ./bin/channels events.js:72 kindly update it again and please if u Don't mind also update |
You're right, fixed now hopefully! |
[root@linx channels]# ./bin/channels
info - socket.io started
/opt/node-esl-master/examples/channels/node_modules/modesl/lib/esl/connection.js:594
doc.row.forEach(function(row) {
^
TypeError: Cannot call method 'forEach' of undefined
at /opt/node-esl-master/examples/channels/node_modules/modesl/lib/esl/connection.js:594:29
at Parser. (/opt/node-esl-master/examples/channels/node_modules/xml2js/lib/xml2js.js:255:20)
at Parser.emit (events.js:95:17)
at Object.saxParser.onclosetag (/opt/node-esl-master/examples/channels/node_modules/xml2js/lib/xml2js.js:225:24)
at emit (/opt/node-esl-master/examples/channels/node_modules/sax/lib/sax.js:615:33)
at emitNode (/opt/node-esl-master/examples/channels/node_modules/sax/lib/sax.js:620:3)
at closeTag (/opt/node-esl-master/examples/channels/node_modules/sax/lib/sax.js:861:5)
at Object.write (/opt/node-esl-master/examples/channels/node_modules/sax/lib/sax.js:1181:11)
at Parser.exports.Parser.Parser.parseString (/opt/node-esl-master/examples/channels/node_modules/xml2js/lib/xml2js.js:273:29)
at Parser.parseString (/opt/node-esl-master/examples/channels/node_modules/xml2js/lib/xml2js.js:6:61)
centos 7
[root@linx channels]# uname -a
Linux linx.lan 3.10.0-229.20.1.el7.x86_64 #1 SMP Tue Nov 3 19:10:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
kindly help me on this to resolve
The text was updated successfully, but these errors were encountered: