Leonidas-from-XIV / node-xml2js

XML to JavaScript object converter.
MIT License
4.88k stars 602 forks source link

Cannot read property 'prototype' of undefined. (sax) #529

Closed Domvel closed 5 years ago

Domvel commented 5 years ago

Since a Update from Ionic v3 to Ionic v4 - Angular 5.x to 8.x - I get this error message. @Leonidas-from-XIV Do you have an idea? Previously I got some errors about stream and timers. So I followed the solution on stackoverflow. But I have no idea what's wrong. I do not want the stream and timers deps. (btw. stream last commit is over 7 years old. timers 5 years.)

sax.js:222 Uncaught TypeError: Cannot read property 'prototype' of undefined
    at sax.js:222
    at Object../node_modules/xml2js/node_modules/sax/lib/sax.js (sax.js:1565)
    at __webpack_require__ (bootstrap:84)
    at Object.<anonymous> (parser.js:9)
    at Object../node_modules/xml2js/lib/parser.js (parser.js:373)
    at __webpack_require__ (bootstrap:84)
    at Object.<anonymous> (xml2js.js:12)
    at Object../node_modules/xml2js/lib/xml2js.js (xml2js.js:39)
    at __webpack_require__ (bootstrap:84)
    at Module../src/app/helper/xml2js.ts (xml2js.ts:1)
Package Version
xml2js 0.4.21
timers 0.1.1
stream 0.0.2
knoxcard commented 5 years ago

Can you post your code on here?

Domvel commented 5 years ago

What kind of code? There is no code. It's just a simple Ionic 4 (Angular 8) project. I think there is a compatibility problem with Webpack. (With Ionic v3, Angular 5.x it works.) No offense, but I switched to another xml parser. I close this issue. Be free to re-open it if you want.

knoxcard commented 5 years ago

No offense taken, just wanted to dive deeper into the issue. Right off the bat, it appears streams hasn't been updated since 2016 and timers since 2014.