preactjs / next-plugin-preact

Next.js plugin for preact X
395 stars 9 forks source link

TypeError: Cannot read property 'tap' of undefined in DEV #19

Open danielzzz opened 3 years ago

danielzzz commented 3 years ago

hi, I am getting a webpack error when trying to run with this plugin in dev. Production seems to be working fine. Do you have any idea what might be causing it?

package.json

"webpack": "latest",
"next-plugin-preact": "^3.0.3",
"preact": "^10.5.10",
"preact-render-to-string": "^5.1.12",
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
 "react-ssr-prepass": "npm:preact-ssr-prepass",

it happens only when using:

const withPreact = require('next-plugin-preact');

I seems that the aliases in package.json make it work even so, as the build size keeps reduced even if I disable it.

cheers, dan

Drew-Garratt commented 3 years ago

Seeing the same behaviour as above

iam4x commented 3 years ago

Yes, next v10.0.6 breaks the plugin. For now you can fix your next dependency in your package.json =>

"next": "10.0.5",
ronanlevesque commented 3 years ago

hey @iam4x 👋

I tried downgrading to 10.0.5, but I still get the Cannot read property 'tap' of undefined error

iam4x commented 3 years ago

Hey, can you run npm ls next and npm ls webpack and make sure you are using next@10.0.5 and webpack@^5.21.2 ?

image

image

With these two versions set, and clean node_modules folder I have no issues:

image

ronanlevesque commented 3 years ago

npm ls next returns (empty) for some reason, but my yarn.lock correcty shows next@10.0.5.

npm ls webpack returns 5.21.2 indeed

And I still get the error after a clean install 😞

mvarendorff commented 3 years ago

This appears to be the same as https://github.com/JoviDeCroock/prefresh/issues/276; using webpack@^4.46.0 appears to work as a solution for this.

JoviDeCroock commented 3 years ago

Hey @danielzzz is this issue still present with the newer versions of prefresh & this plugin?