adriantoine / enzyme-to-json

Snapshot test your Enzyme wrappers
MIT License
947 stars 64 forks source link

3.4.1 error -- TypeError: Cannot read property '$$typeof' of undefined #148

Closed amitmaor closed 5 years ago

amitmaor commented 5 years ago

Hi there, I'm getting the following error in my tests in files using enzyme-to-json:

TypeError: Cannot read property '$$typeof' of undefined

      at extractTypeName (node_modules/enzyme-to-json/utils.js:61:24)
      at internalNodeToJson (node_modules/enzyme-to-json/shallow.js:62:38)
      at node_modules/enzyme-to-json/shallow.js:23:12
          at Array.map (<anonymous>)
      at getChildren (node_modules/enzyme-to-json/shallow.js:22:78)
      at internalNodeToJson (node_modules/enzyme-to-json/shallow.js:64:15)
      at node_modules/enzyme-to-json/shallow.js:23:12
          at Array.map (<anonymous>)
      at getChildren (node_modules/enzyme-to-json/shallow.js:22:78)
      at internalNodeToJson (node_modules/enzyme-to-json/shallow.js:64:15)
      at node_modules/enzyme-to-json/shallow.js:23:12
          at Array.map (<anonymous>)
      at getChildren (node_modules/enzyme-to-json/shallow.js:22:78)
      at internalNodeToJson (node_modules/enzyme-to-json/shallow.js:64:15)
      at shallowToJson (node_modules/enzyme-to-json/shallow.js:89:12)
      at Object.<anonymous>.exports.default (node_modules/enzyme-to-json/index.js:10:34)
      at Object.<anonymous> (src/components/MyComponent/index.test.js:21:43)
          at new Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

This is only happening on 3.4.1 which npm tells me was released less than an hour ago. If I go back to my previous version (3.3.5) this error goes away.

Just wanted you to be aware! Not currently blocked since 3.3.5 is working fine for me.

silentroach commented 5 years ago

the same was in #122

VincentLanglet commented 5 years ago

This should be introduce by https://github.com/adriantoine/enzyme-to-json/pull/145/files#diff-2b4ca49d4bb0a774c4d4c1672d7aa781

Do you have a way to reproduce the bug ?

VincentLanglet commented 5 years ago

This should fix the bug https://github.com/adriantoine/enzyme-to-json/pull/149/files

VincentLanglet commented 5 years ago

Since there is another problem with the PR (see https://github.com/adriantoine/enzyme-to-json/issues/150), I made a revert temporary and deploy a new release 3.4.2