question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vite beta-12, TypeError: Cannot read property '__e' of undefined

See original GitHub issue

Error

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:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
JoviDeCroockcommented, Jul 23, 2020

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, …

1reaction
JoviDeCroockcommented, Aug 3, 2020

Good spot, seems like prepublishOnly didn’t run. Hope that’s not a changesets bug 😅

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found