unable to resolve module ../Observable from this path

39 Views Asked by At

i was doing offline feature in my react native app using typescript and i have used watermellonDB as my local database and i have come across this error how can i solve it?

**`error: Error: Unable to resolve module ../../Observable from C:\Users\DELL\Desktop\projects\work\addo-app\node_modules\rxjs\dist\cjs\internal\observable\dom\animationFrames.js:

None of these files exist:

  • node_modules\rxjs\dist\cjs\internal\observable(.native|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • node_modules\rxjs\dist\cjs\internal\observable\index(.native|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.animationFrames = void 0;

4 | var Observable_1 = require("../../Observable"); | ^ 5 | var performanceTimestampProvider_1 = require("../../scheduler/performanceTimestampProvider"); 6 | var animationFrameProvider_1 = require("../../scheduler/animationFrameProvider"); 7 | function animationFrames(timestampProvider) { at ModuleResolver.resolveDependency (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:137:15) at DependencyGraph.resolveDependency (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\node-haste\DependencyGraph.js:260:43) at Object.resolve (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\lib\transformHelpers.js:177:21) at Graph._resolveDependencies (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\DeltaBundler\Graph.js:432:35) at Graph._processModule (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\DeltaBundler\Graph.js:218:38) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Graph._addDependency (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\DeltaBundler\Graph.js:314:20) at async Promise.all (index 3) at async Graph._processModule (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\DeltaBundler\Graph.js:263:5) at async Graph._addDependency (C:\Users\DELL\Desktop\projects\work\addo-app\node_modules@react-native-community\cli-plugin-metro\node_modules\metro\src\DeltaBundler\Graph.js:314:20)`**

after tracking down what is the issue i found out that when i use this line of codes it gives me error


const adapter = new SQLiteAdapter({
  schema,
  migrations,
  // jsi: true, /* Platform.OS === 'ios' */
  // (optional, but you should implement this method)
  onSetUpError: error => {
    // Database failed to load -- offer the user to reload the app or log out
  }
})

// Then, make a Watermelon database from it!
export const database = new Database({
  adapter,
  modelClasses: [
    OptionModel,
  ],
})

but when I commented them, the error doesn't occur, help please....

i have tried to install Rxjs-compact but nothing worked, i have try to delete the node_modules and reinstall it still not working, i have also clean all caches and rebuilt my project.

0

There are 0 best solutions below