-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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')" after migrating from 2.9.15 to 3.2.0 #10664
Comments
Still happens with vite 3.2.2 |
@barbalex Can you try with v3.1.4? From v3.1.5, I get this |
@a-kriya |
This seems similar to #7555 but that is supposed to have been solved by #8338. I also have xml.js in my dependency tree: PS C:\Users\alexa\capturing> yarn why xml-js
├─ react-xml-viewer@npm:1.3.0
│ └─ xml-js@npm:1.6.11 (via npm:^1.6.11)
│
└─ react-xml-viewer@npm:1.3.0 [3bf5a]
└─ xml-js@npm:1.6.11 (via npm:^1.6.11) If I remove How can this be solved? And why was this case not solved by #8338? |
I found a solution here: alissonmbr/react-xml-viewer#15 (comment):
But: is this a solution are just a workaround? Why did it work with vite v2 but in v3 only with stream and buffer? What do you think @bluwy ? |
Also: adding stream lead to this error: juliangruber/stream#5 (comment) |
I did not find a fix for this on ^3.1.5, and instead jumped to some v4 where it did not happen. |
This happened to work in 2.x by the reason how Vite mocks Node.js builtin modules. The following codes are how Vite mocked/mocks Node.js builtin modules in each version. 2.9.15 export default new Proxy({}, {
get() {
throw new Error()
}
}) 3.0.x module.exports = Object.create(new Proxy({}, {
get(_, key) {
if (key !== '__esModule' &&
key !== '__proto__' &&
key !== 'constructor' &&
key !== 'splice'
) {
throw new Error()
}
}
})) 3.1.0+ module.exports = Object.create(new Proxy({}, {
get(_, key) {
if (key !== '__esModule' &&
key !== '__proto__' &&
key !== 'constructor' &&
key !== 'splice'
) {
console.warn()
}
}
})) Some packages expects modules to be mocked as |
Describe the bug
In this project I want to upgrade vite and it's plugins.
Every time I do it the previously working project breaks i.e. the browser window is blank and devtools shows:
The issue seems similar to #7555 and #8646.
Reproduction
https://github.com/barbalex/capturing
Steps to reproduce
Clone https://github.com/barbalex/capturing and cd into it's folder, then:
See that it works (the app will be missing it's database of course).
Now update in package.json:
Run
yarn
Now run
yarn dev
and check the console in chrome's dev toolsSystem Info
Used Package Manager
yarn
Logs
I get so many messages, it's not worth pasting all. There seem to be no errors here. Small extract:
Validations
The text was updated successfully, but these errors were encountered: