Build fails when using hooks
See original GitHub issueHey!
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:
- Created 5 years ago
- Reactions:2
- Comments:20 (5 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
Using Rollup can build.
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.