wix / react-native-calendars

React Native Calendar Components πŸ—“οΈ πŸ“†
MIT License
9.46k stars 2.93k forks source link

Unable to resolve module ../component-updater #1710

Closed RimApp closed 2 years ago

RimApp commented 2 years ago

Hi all ! Can someone help me please?

Description

I can no longer build my react native project on my android device. I got the error : Unable to resolve module ../component-updater

Expected Behavior

I did : ./gradlew clean remove package-lock.json and node_modules npm cache clean and finally npm install

Observed Behavior

error: Error: Unable to resolve module ../component-updater from ...\node_modules\react-native-calendars\src\calendar\index.js:

None of these files exist:
  * node_modules\react-native-calendars\src\component-updater(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * node_modules\react-native-calendars\src\component-updater\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
> 1 | import invoke from 'lodash/invoke';
  2 | import PropTypes from 'prop-types';
  3 | import XDate from 'xdate';
  4 | import memoize from 'memoize-one';
    at ModuleResolver.resolveDependency (...\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:211:15):15)    at DependencyGraph.resolveDependency (...\node_modules\metro\src\node-haste\DependencyGraph.js:413:43)        
    at Object.resolve (...\node_modules\metro\src\lib\transformHelpers.js:317:42)
    at ...\node_modules\metro\src\DeltaBundler\traverseDependencies.js:645:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (...\node_modules\metro\src\DeltaBundler\traverseDependencies.js:644:33)
    at ...\node_modules\metro\src\DeltaBundler\traverseDependencies.js:329:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (...\node_modules\metro\src\DeltaBundler\traverseDependencies.js:137:24)

Environment

Please run these commands in the project folder and fill in their results:

hoanganhle1996 commented 2 years ago

Did you solve it yet ?

VirtualDOMinic commented 2 years ago

This won't be of much help, but one thing that worked for my colleague just now was using v 1.1266.0 . Can't vouch for other versions, but another, newer, one might also work:

  1. "react-native-calendars": "1.1266.0" in package.json
  2. remove package-lock and node_modules
  3. npm i
  4. success

Sorry for brief nature of this reply -- I've got a busy morning! Hopefully this will help you for now, until a proper solution comes along!

RimApp commented 2 years ago

@hoanganhle1996 I cloned my repo in a previous version. I can no longer reproduce @VirtualDOMinic Thank you for the tip ! If I reproduce I will try this solution

owenadley commented 2 years ago

@RimApp what did you do to fix the issue?

RimApp commented 2 years ago

@RimApp what did you do to fix the issue?

I just use a previous version of my app, so a previous version of react-native-calendars and clean the node module ( remove package-lock.json and node_modules folder and finally npm i.

If still not working try these:

  1. use previous version of react-native-calendars
  2. cd android
  3. .\gradlew clean
  4. cd ..
  5. Remove-Item package-lock.json , node_modules -Force -Recurse
  6. npm cache clean --force
  7. npm i

and in two differents terminal, run : react-native start --reset-cache npx react-native run-android