app.js:16 Uncaught TypeError: Cannot read properties of undefined (reading '__H')
See original GitHub issueI’ve got a problem when building Preact with gulp.
After building the project my console gives me this error: “app.js:16 Uncaught TypeError: Cannot read properties of undefined (reading ‘__H’)”
And this is the code where import the useState
` import { useState } from ‘preact/compat’;
const [count, setCount] = useState(0);
const increment = () => setCount(count + 1);
export default () => ( <div> <button onClick={increment}>{count}</button> </div> ); `
and this is the function in my gulpfile.js:
does someone know how i can fix this problem? or are there any recommendations as alternative for gulp?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
app.js:12 Uncaught TypeError: Cannot read properties of ...
app.js:12 Uncaught TypeError: Cannot read properties of undefined (reading 'className') at HTMLDivElement.<anonymous> (app.js:12: ...
Read more >Why do I get the "cannot read property 'h' of undefined" error?
It seems you are mixing up Apex and Javascript. Please try with below. let defaultCurrency = cmp.get('v.defaultCurrency'); let action ...
Read more >Cannot read properties of undefined' - JavaScript Debugging
How To Fix ' Uncaught TypeError : Cannot read properties of ... "Uncaught Typerror: Cannot set properties of null ( reading 'innerHTML')".
Read more >Cannot read property 'get' of undefined. May i know if there ...
Error is: [Cannot read property 'get' of undefined] Below is the code that i had in my controller and helper. controller:
Read more >Fix 'cannot read properties of undefined (reading map)' in JS
The "Uncaught TypeError: Cannot read properties of undefined (reading 'map')" error occurs in JavaScript, whenever you try to use the array ...
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
Found a fix for my situation: use an other browser. Which makes me realize it was due to browser cache so I reloaded the page with cache disabled in chrome devtools. Now the issue is gone.
This suggest
@prefresh/core@1.3.4
depends on preact “10.0.0” but I have opened the package.json and found the following:I tried to reinstall from scratch with the following
The issue persists: I still have 2 versions of preact (10.0.0 and 10.0.6) in node modules My npm version is 8.5