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

Uncaught TypeError: Cannot read properties of undefined (reading 'prototype') #651

Open
damianof opened this issue Jul 25, 2022 · 2 comments

Comments

@damianof
Copy link

Getting this with version 0.4.23:

Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at sax.js:222:46
at node_modules/sax/lib/sax.js (sax.js:1565:1)
at __require (chunk-UNANNA3Z.js?v=1c06db08:38:50)
at Object. (parser.js:9:9)
at node_modules/xml2js/lib/parser.js (parser.js:381:4)
at __require (chunk-UNANNA3Z.js?v=1c06db08:38:50)
at Object. (xml2js.js:12:12)
at node_modules/xml2js/lib/xml2js.js (xml2js.js:39:4)
at __require (chunk-UNANNA3Z.js?v=1c06db08:38:50)
at dep:xml2js:1:16

SAXStream.prototype = Object.create(Stream.prototype, { // Stream seems to be undefined
constructor: {
value: SAXStream
}
})

@mathieuguyot
Copy link

mathieuguyot commented Jul 26, 2022

Hi I faced the same issue, if you are using vite, please take a look at vitejs/vite#7555
what worked for me was to add
resolve: { alias: { stream: "stream-browserify" } }
inside the defineConfig of your vite.config.ts

or simply add stream dependency

@BugKiller-tech
Copy link

BugKiller-tech commented Jul 24, 2023

@mathieuguyot
Hi, Should I install the npm package stream-browserify?

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

No branches or pull requests

3 participants