Vite beta-12, TypeError: Cannot read property '__e' of undefined
See original GitHub issueError
catchError.js:8 Uncaught TypeError: Cannot read property '__e' of undefined
at catchError.js:8
Happens in catchError.js
import { options } from '/@modules/preact/dist/preact.module.js';
import {
CATCH_ERROR_OPTION,
COMPONENT_DIRTY,
VNODE_COMPONENT
} from '/@modules/@prefresh/core/src/constants.js';
const oldCatchError = options[CATCH_ERROR_OPTION]; // options is undefined here
options[CATCH_ERROR_OPTION] = (error, vnode) => {
if (vnode[VNODE_COMPONENT] && vnode[VNODE_COMPONENT][COMPONENT_DIRTY]) {
vnode[VNODE_COMPONENT][COMPONENT_DIRTY] = false;
}
if (oldCatchError) oldCatchError(error, vnode);
};
Somehow it seems that Preact is not imported correctly. 🤷 I have tried to find the reason, but so far without success. Vite has introduced a breaking change in beta-2 that the vite client path has changed from /vite/hmr to /vite/client. Maybe it is related.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Vite + React: "TypeError: Cannot read properties of undefined ...
Describe the bug I'm running an app with react-tsparticles and mui. Whenever I run the app with vite everything works like a charm, ......
Read more >vite + vue TypeError: Cannot read properties of undefined ...
ur using script setup, this is undefined, just use vars <script setup> import { computed, ref, watch } from "vue"; // smth like...
Read more >Cannot Read Property Length of Undefined in JavaScript
The JavaScript TypeError: Cannot read property 'length' of undefined occurs when the length property is read on an undefined variable.
Read more >Avoiding those dang cannot read property of undefined errors
Uncaught TypeError: Cannot read property 'foo' of undefined. The dreaded error we all hit at some point in JavaScript development.
Read more >How to Fix TypeError: Cannot read Property 'push' of ...
How to Fix TypeError: Cannot read Property 'push' of Undefined in JavaScript · You call the method on a variable previously set to...
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
Everything under 0.10.x is not compatible with the 1.0.0 line of vite, I’ve contacted people at vite about this since there were no evident breaking changes in
beta.12
so this might be a bug with export mangling, …This could also be related to how modules are loaded, …
Good spot, seems like prepublishOnly didn’t run. Hope that’s not a changesets bug 😅