React-native-reanimated: Unable to resolve module `./abs`

Created on 22 Jul 2020  路  11Comments  路  Source: software-mansion/react-native-reanimated

Description

After getting the new update for the package, we are getting the following errors on our project:

Screenshots

image

Steps To Reproduce

No idea about steps to reproduce, but our project works fine with 1.9.0

Expected behavior

It works just as before.

Actual behavior

Throws an error seen above.

Package versions

  • React:^16.12.0
  • React Native: ^0.61.4
  • React Native Reanimated: 1.10.0
馃悶 Bug

Most helpful comment

@jakub-gonet I think in my case watchman was the culprit as even after --reset-cache the issue was still there.

watchman watch-del-all
npm run start -- --reset-cache

If it fails, the overkill way:

rm -rf node_modules && npm install
(cd android && ./gradlew clean)
(cd ios && pod install)
watchman watch-del-all
npm run start -- --reset-cache

All 11 comments

Same there!

It may be connected with new build system, will test that shortly!

Thanks for letting us know

@dsemennyuk, @richardszanyi, could you guys run

  1. yarn remove react-native-reanimated
  2. rm -rf node_modules/react-native-reanimated
  3. yarn add [email protected]

And post here content of src/derived/index.js file? (less node_modules/react-native-reanimated/src/derived/index.js)?

I cannot use yarn on my environment, we have not yet used it, so I would not fiddle with it now.
Nontheless, the requested file's content is:

export { default as acc } from './acc'; export { default as color } from './color'; export { default as diff } from './diff'; export { default as diffClamp } from './diffClamp'; export { default as interpolate, Extrapolate } from './interpolate'; export { default as interpolateColors } from './interpolateColors'; export { default as onChange } from './onChange'; export { default as useCode } from './useCode';

You can use npm as well, I just want to make sure it isn't connected to any stale cache.

In 1.10.0 we moved abs from js to native side, so metro doesn't recognize it. Try running it with --reset-cache switch

I also have this issue.

3. add [email protected]

This doesn't fix it either.

@jakub-gonet I think in my case watchman was the culprit as even after --reset-cache the issue was still there.

watchman watch-del-all
npm run start -- --reset-cache

If it fails, the overkill way:

rm -rf node_modules && npm install
(cd android && ./gradlew clean)
(cd ios && pod install)
watchman watch-del-all
npm run start -- --reset-cache

I tried to reproduce it on the fresh project and it doesn't happen, so I'm assuming this is related to the caches. If you still experience this issue after resetting caches like @kamui545 shown, please reply.

I had the same problem, but doing:

  1. cd android && gradlew clean && cd ..
  2. npx react-native start --reset-cache
  3. npm run start -- --reset-cache

Solved the problem.

@jakub-gonet I think in my case watchman was the culprit as even after --reset-cache the issue was still there.

watchman watch-del-all
npm run start -- --reset-cache

If it fails, the overkill way:

rm -rf node_modules && npm install
(cd android && ./gradlew clean)
(cd ios && pod install)
watchman watch-del-all
npm run start -- --reset-cache

I tried running all of those commands, but nothing seems to work. I'm still getting this error, only on android though since iOS works perfectly fine. Anyone knows what else this could possibly be?

Any update? As @mrousavy I tried everything suggested and nothing helped

Edit: Deleting the local repo and reset it did it for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zxccvvv picture zxccvvv  路  3Comments

WeTruck picture WeTruck  路  3Comments

wasim-abuzaher picture wasim-abuzaher  路  3Comments

sa8ab picture sa8ab  路  3Comments

ShaMan123 picture ShaMan123  路  3Comments