next-plugin-preact icon indicating copy to clipboard operation
next-plugin-preact copied to clipboard

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

Open danielzzz opened this issue 5 years ago • 7 comments

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

danielzzz avatar Jan 20 '21 16:01 danielzzz

Seeing the same behaviour as above

drew-foxall avatar Jan 31 '21 16:01 drew-foxall

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

"next": "10.0.5",

iam4x avatar Feb 08 '21 10:02 iam4x

hey @iam4x 👋

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

ronanlevesque avatar Feb 09 '21 10:02 ronanlevesque

Hey, can you run npm ls next and npm ls webpack and make sure you are using [email protected] and webpack@^5.21.2 ?

image

image

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

image

iam4x avatar Feb 09 '21 10:02 iam4x

npm ls next returns (empty) for some reason, but my yarn.lock correcty shows [email protected].

npm ls webpack returns 5.21.2 indeed

And I still get the error after a clean install 😞

ronanlevesque avatar Feb 09 '21 10:02 ronanlevesque

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.

mvarendorff avatar Feb 23 '21 19:02 mvarendorff

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

JoviDeCroock avatar May 21 '21 08:05 JoviDeCroock