mattphillips / deep-object-diff

Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️
https://www.npmjs.com/package/deep-object-diff
MIT License
1.05k stars 89 forks source link

Cannot resolve module `deep-object-diff` #37

Closed stefanfrede closed 6 years ago

stefanfrede commented 6 years ago

After installing I get the error Cannot resolve module 'deep-object-diff'.

I installed and implemented it the way you provided:

npm i --save deep-object-diff
import { updatedDiff } from 'deep-object-diff';
mattphillips commented 6 years ago

Hey @stefanfrede seems strange!

I've just tried it myself and all seems to be working OK, I'd say that it is probably something going wrong with your setup. Are you able to share a reproduction repo with the problem?

Have you tried deleting your project node_modules and doing a fresh install and then check the package is in your node_modules.

stefanfrede commented 6 years ago

Hi!

I set up a test repo (https://github.com/stefanfrede/deep-object-diff-test-repo), and there it is working fine.

I tried again in my project, and I get Cannot resolve moduledeep-object-diff.:.

I then deleted node_modules and did a fresh install, and the package seems to be installed, but I get the same error.

I have no clue what is going wrong, but I guess there is some interference with another/other package/packages.

stefanfrede commented 6 years ago

I found the culprit. It is flow. I removed /* @flow */ which stopped the type checking for the file and the error message disappeared.

stefanfrede commented 6 years ago

I'm closing this because I solved it (somehow).