flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot set property 'DeepDiff' of undefined

xavdid opened this issue · comments

Using version 1.0.1, I'm getting that error thrown here.

What's weird is that the code works fine in isolation, but when dropped into my company's monolith, I get that error when running tests. Given that, my guess is that it's related to our using babel-jest, which does some pre-processing on our code.

It looks like #129 addressed this, but there might still be something up with it.

Got the same issue here on 1.0.1 in a react-native project.

Heya! Got the same issue on libraries which have this as a dependency. What workarounds/fixes did you guys settle on? @xanderberkein @xavdid

@ellej16 Check out my PR! #134

Heya! Quite new in js so i don't understand much how it got fixed, but I suppose the PR fixes web issues as well?

Hopefully this one gets merged and released soon! In the meantime might have to use another library unfortunately :/ (will use it at a different project hopefully!)

But thanks for replying @xanderberkein !

The PR works for any environment where root isn't defined.

You can try testing it out by importing my branch in your "main" project. All dependencies should use that version as well then:

yarn add github:xanderberkein/diff#master

@xanderberkein any chance of that getting merged here and released as part fo the original diff?

Yes, my PR has been merged! Should be part of diff since 1.0.2

Ah, perfect! I've confirmed this is resolved. Thanks so much.