I get this error when i try to use @openmrs/react-components

I just installed @openmrs/react-components in my OWA and I get this error

ERROR in ./~/@openmrs/react-components/lib/components/localization/test/helpers/intl-test.js

Module not found: Error: Cannot resolve module 'enzyme' in /home/andu033/attachmentsUI/node_modules/@openmrs/react-components/lib/components/localization/test/helpers

 @ ./~/@openmrs/react-components/lib/components/localization/test/helpers/intl-test.js 14:14-31

ERROR in ./~/@openmrs/react-components/lib/components/localization/test/helpers/intl-test.js

Module not found: Error: Cannot resolve module 'enzyme-adapter-react-16' in /home/andu033/attachmentsUI/node_modules/@openmrs/react-components/lib/components/localization/test/helpers

 @ ./~/@openmrs/react-components/lib/components/localization/test/helpers/intl-test.js 16:26-60

@mogoodrich Do you know someone to get this error? Thanks

@andu033 sorry, I haven’t seen that one before…

@mogoodrich but this error? https://pastebin.com/aB4TrYZ1 . It got something to do with the babel-loader

What’s in your package.json? I wonder if it’s related to some peer dependency conflicts

https://pastebin.com/Svaprd9H here is my package.json of my owa

Try upgrading your libraries. It looks like @openmrs/react-components require "react": "^16.4.0", "react-dom": "^16.3.2" but you provided "react": "^15.4.1", 2. "react-dom": "^15.4.1",

Also, try to update the version of babel and webpack and make sure you webpack configuration uses the babel-loader. Something similar to

{
        test: /\.(js|jsx)$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
}

I did and i get same errors

Upgrading babel-loader change the error in this

ERROR in ./app/js/app1.jsx
Module build failed: TypeError: fileSystem.statSync is not a function
    at module.exports (/home/andu033/Documents/test/node_modules/babel-loader/lib/utils/exists.js:7:25)
    at find (/home/andu033/Documents/test/node_modules/babel-loader/lib/resolve-rc.js:13:9)
    at Object.module.exports (/home/andu033/Documents/test/node_modules/babel-loader/lib/index.js:111:132)

Googling around hints that actually downgrading babel-loader might solve the issue? Did you try that?