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.

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 issue

Hi, 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?)

https://github.com/vercel/next.js/blob/c11ee1d8573c2c264ee146b365900dce25ac0f4d/examples/using-preact/package.json#L17-L19

I’m just curious whether this is correct or if I should change the alias library. Thank you, keep being awesome 😃

Issue Analytics

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

github_iconTop GitHub Comments

0reactions
GavinRay97commented, Aug 6, 2020

Ahh alright, understood now. Thanks everyone, clears up the confusion, appreciate the responses =)

Read more comments on GitHub >

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

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