Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin dependency requirements break testing abilities #43

Open
Paratron opened this issue Aug 27, 2021 · 1 comment
Open

Plugin dependency requirements break testing abilities #43

Paratron opened this issue Aug 27, 2021 · 1 comment

Comments

@Paratron
Copy link

When I try to install the plugin into our Next.js 11.1 project, I run into serious problems because of the dependency requirements of the plugin.

When I start up my next dev server, I get this message:

[preact] Missing/incorrect dependencies.
Please run:
  npm i react@npm:@preact/compat react-dom@npm:@preact/compat

or:

  yarn add react@npm:@preact/compat react-dom@npm:@preact/compat

So far so good - the problem is, when I completely override the react and react-dom dependencies in npm, the next.js build itself works just fine, but it breaks all unit tests in jest either using react-test-renderer or enzyme-adapter-react-16. The problem is that those testing libs try to access features inside the libaries which are not contained in preact/compat (for example react-dom/test-utils).

Is it really necessary to alias the react and react-dom modules "globally" for the whole project?

@rschristian
Copy link
Member

Any chance you have a reproduction? I think we're just missing an alias here, though I'm not a Next or Jest user myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants