Closed karltaylor closed 2 years ago
This was likely a result of this change: https://github.com/preactjs/preact/pull/3320/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L70
... which made require.resolve('preact/compat/package.json')
throw instead of resolving.
@karltaylor Preact 10.6.2 has been released which will correct this issue.
@rschristian woop woop. That's awesome. Thank you so much, super quick fix!
What is the current behaviour? A clear and concise description of what the bug is.
It seems as if the
preact-cli
is using the wrongconfig.resolve.alias
forreact
andreact-dom
.Following this guide, it said compat has moved to core, and that you must now use
preact/compat
instead ofpreact-compat
, it also said "If you're using preact-cli than this step is already done for you 🎉".However this does not seem to be the case.
Steps to Reproduce Steps to reproduce the behavior:
I have created a minimum reproducible example with the error and how I got around it. It is a simple
preact-cli create
repo with a react npm modulereact-intersection-observer
.yarn dev
to get it running, an error occurs stating thatreact-intersection-obvserver
cannot find react:$ touch preact.config.js
and to check the current config:preact.config.js
to be:yarn dev
and the project was able to compileWhat is the expected behaviour?
The config to be correct / not error when using
preact-cli create
Additional Info
What I found on my debugging journey (This happened deploying to vercel and they only let you use major versions of node (
12.x
and14.x
. But I discovered that it it works onnode v12.16.3 (npm v6.14.9)
, and the config is this:However, using
node v14.18.1 (npm v6.14.15)
, this config is the erroneous one:Please paste the results of
npx preact-cli info
here.