preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
949 stars 148 forks source link

Error: Can't resolve 'preact-compat/lib/EventPluginHub' #485

Closed DannyAziz closed 6 years ago

DannyAziz commented 6 years ago

I am trying to install https://github.com/LogRocket/logrocket-react but am getting this error:

Build failed!

✖ ERROR ./node_modules/logrocket-react/dist/index.js
Module not found: Error: Can't resolve 'preact-compat/lib/EventPluginHub' in '/vagrant/data/frontend/PROJECTNAME/node_modules/logrocket-react/dist'
 @ ./node_modules/logrocket-react/dist/index.js 8:22-65
 @ ./src/components/app.js
 @ ./src/index.js
 @ /home/vagrant/.nvm/versions/node/v9.7.1/lib/node_modules/preact-cli/lib/lib/entry.js
 @ multi /home/vagrant/.nvm/versions/node/v9.7.1/lib/node_modules/preact-cli/lib/lib/entry webpack-dev-server/client webpack/hot/dev-server

Tried following the solution in #368 but it didn't help

I am using preact-cli.

Would love some help!

developit commented 6 years ago

I don't think we can ever support that library in Preact, and I wouldn't recommend using it in general. Looking at the implementation will show you why: https://github.com/LogRocket/logrocket-react/blob/master/src/index.js#L1-L3

Perhaps just use LogRocket without the React integration? All it does is annotate events with a minified component name.

DannyAziz commented 6 years ago

Alright cool, thanks for the explanation!