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

Enzyme Internal Error: configured enzyme adapter did not inherit from the EnzymeAdapter base clas #1437

Closed
zachrickards opened this issue Dec 15, 2017 · 5 comments

Comments

@zachrickards
Copy link

I'm getting this error and there is no documentation on it or information I can find anywhere.

@ljharb
Copy link
Member

ljharb commented Dec 16, 2017

This implies that you have more than one copy of enzyme in your dependency graph. What does npm ls say?

@smackjax
Copy link

@zachrickards
Hi! I hope you figured something out by now, but I had the same error from configure()-ing like
{ adapter: ReactAdapter }
instead of
{ adapter: new ReactAdapter() }
in case someone else finds this helpful.

@ljharb
Copy link
Member

ljharb commented Dec 31, 2017

That sounds like a specific case we could check for, and provide a more helpful error message. Alternatively, we could detect it and silently instantiate it for you.

@ohmyhusky
Copy link

I got the same error. I use yarn workspaces to manage packages and happened to have "enzyme": "^3.2.0", in one package and have "enzyme": "^3.3.0", in another one. And the corresponding section in yarn.lock is

enzyme@^3.2.0:
  version "3.2.0"
  resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.2.0.tgz#998bdcda0fc71b8764a0017f7cc692c943f54a7a"
  dependencies:
    cheerio "^1.0.0-rc.2"
    function.prototype.name "^1.0.3"
    has "^1.0.1"
    is-subset "^0.1.1"
    lodash "^4.17.4"
    object-is "^1.0.1"
    object.assign "^4.0.4"
    object.entries "^1.0.4"
    object.values "^1.0.4"
    raf "^3.4.0"
    rst-selector-parser "^2.2.3"

enzyme@^3.3.0:
  version "3.3.0"
  resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.3.0.tgz#0971abd167f2d4bf3f5bd508229e1c4b6dc50479"
  dependencies:
    cheerio "^1.0.0-rc.2"
    function.prototype.name "^1.0.3"
    has "^1.0.1"
    is-boolean-object "^1.0.0"
    is-callable "^1.1.3"
    is-number-object "^1.0.3"
    is-string "^1.0.4"
    is-subset "^0.1.1"
    lodash "^4.17.4"
    object-inspect "^1.5.0"
    object-is "^1.0.1"
    object.assign "^4.1.0"
    object.entries "^1.0.4"
    object.values "^1.0.4"
    raf "^3.4.0"
    rst-selector-parser "^2.2.3"

After change all dependencies to "enzyme": "^3.3.0",, the code ran correctly again. Hope this helped.

@ljharb
Copy link
Member

ljharb commented Jan 13, 2018

@cyl19910101 that seems like an issue with yarn workspaces; you probably want to configure it to insist that there only be one copy of enzyme.

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

No branches or pull requests

4 participants