Next.js + Preact template uses `"react": "github:preact-compat/react#1.0.0"` in package.json but docs say v8+ should use preact/compat?
See original GitHub issueHi, sorry to clutter up your issues with silly questions but I was a bit confused about this one and couldn’t find much after Googling:
The docs for preact/compat
state:
This module is for Preact 8.x and prior - Preact X includes compat by default. For Preact X, please uninstall preact-compat and replace your aliases with preact/compat.
I used the lovely reference implementation with @prefresh
and aliases configured for Next.js, but I noticed that in package.json
the React libs are aliased to preact-compat
and not preact/compat
(maybe because you can’t alias to a sub-module?)
I’m just curious whether this is correct or if I should change the alias library. Thank you, keep being awesome 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
using-preact example / preact 18 compat in general does not ...
Verify canary release. I verified that the issue exists in the latest Next.js canary release. Provide environment information.
Read more >Use Preact in Next.js 13 - DEV Community
Introduction. Next.js uses React by default. In this blogpost, I want to replace React with Preact and compare the build differences.
Read more >module-not-found - Next.js
The swr module has to be installed using a package manager. When using npm : npm ... The module you're trying to import...
Read more >Can't install Next.js with Preact - Stack Overflow
I think this is a bug related to npx. i am using yarn create next-app --example using-preact using-preact-app and it is installed ...
Read more >How To Switch Your Next.js App to Preact Effortlessly
Important: If you look into your package.json now, you see that the dependencies that used to be react, react-dom, and so on got...
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
I think so. Both are using preact/compat v10 behind the scenes.
https://github.com/preact-compat/react/blob/1.x/index.js https://github.com/preact-compat/react/blob/1.x/package.json
https://github.com/preact-compat/react-dom/blob/1.x/index.js https://github.com/preact-compat/react-dom/blob/1.x/package.json
Ahh alright, understood now. Thanks everyone, clears up the confusion, appreciate the responses =)