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.

Build fails when using hooks

See original GitHub issue

Hey!

First of all, thank you for a great work on updating Preact, was waiting for it and totally satisfied!

I have a weird issue when trying to build my app, which is already full of hooks:

Unable to read file: /Users/.../src/node_modules/preact/hooks/dist/hooks.mjs

TypeError: Cannot read property '__H' of undefined

When in a dev mode, everything works like a charm.

I tried to build without prerender, it didn’t help 😦

Any ideas on what it could be? Or maybe anyone have built preact@10 app successfully?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
38elementscommented, Mar 18, 2019

Using Rollup can build.

5reactions
developitcommented, Mar 5, 2019

Hi @flppv! This is most likely an issue with Webpack’s handling of JS Modules. It might be worth trying out this webpack plugin to see if that fixes the production build.

Any chance you could set up a reproduction? I’ll be trying, but it’d be great if you had something handy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

build fails even though dev runs fine, complaining about React ...
The reason that it thinks useFunction is a hook is because that's how React's linting checks work. They rely on the use prefix...
Read more >
Understanding common frustrations with React Hooks
React Hooks can be frustrating despite their popularity and widespread use. Learn about some of the drawbacks to using React Hooks.
Read more >
Invalid Hook Call Warning - React
You are probably here because you got the following error message: Hooks can only be called inside the body of a function component....
Read more >
"Error building project: The build hook failed with status code 1".
Solution · Check to ensure that there is enough storage. · Ensure ECE-Tools are configured correctly. · Check if it is the patch...
Read more >
Build Hooks - Builds | OpenShift Container Platform 3.11
The hook fails if the script or command returns a non-zero exit code or if starting the temporary container fails. When the hook...
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