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.

app.js:16 Uncaught TypeError: Cannot read properties of undefined (reading '__H')

See original GitHub issue

I’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’)”

image

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:

image

does someone know how i can fix this problem? or are there any recommendations as alternative for gulp?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dmailcommented, Sep 6, 2022

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.

0reactions
dmailcommented, Sep 6, 2022

This suggest @prefresh/core@1.3.4 depends on preact “10.0.0” but I have opened the package.json and found the following:


  "peerDependencies": {
    "preact": "^10.0.0"
  }

I tried to reinstall from scratch with the following

rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install

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

Read more comments on GitHub >

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

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