f-23 / react-native-passkey

Passkeys for React Native
MIT License
121 stars 25 forks source link

Importing error #5

Closed EricBorland closed 1 year ago

EricBorland commented 1 year ago

I'm seeing an error when importing/requiring this module after installation where the file linked in mail does not exist.

What's the proper way to import this module after installation?

Context: In package.json the react-native property is set to src/index which is not found on the npm distributed package. When changing that to lib/module/index all works just fine. Should that change be in the npm package or I'm importing it wrong?

Here's the error and the screenshot

error: Error: While trying to resolve module `react-native-passkey` from file `<masked_path>`, the package `<masked_path>mobileapp/node_modules/aws-cognito-passwordless/client/node_modules/react-native-passkey/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`<masked_path>mobileapp/node_modules/aws-cognito-passwordless/client/node_modules/react-native-passkey/src/index`. Indeed, none of these files exist:

  * <masked_path>mobileapp/node_modules/aws-cognito-passwordless/client/node_modules/react-native-passkey/src/index(.native|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  * <masked_path>mobileapp/node_modules/aws-cognito-passwordless/client/node_modules/react-native-passkey/src/index/index(.native|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
    at DependencyGraph.resolveDependency (<masked_path>mobileapp/node_modules/metro/src/node-haste/DependencyGraph.js:277:17)
    at Object.resolve (<masked_path>mobileapp/node_modules/metro/src/lib/transformHelpers.js:170:21)
    at resolveDependencies (<masked_path>mobileapp/node_modules/metro/src/DeltaBundler/graphOperations.js:466:33)
    at processModule (<masked_path>mobileapp/node_modules/metro/src/DeltaBundler/graphOperations.js:232:31)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async addDependency (<masked_path>mobileapp/node_modules/metro/src/DeltaBundler/graphOperations.js:361:18)
    at async Promise.all (index 6)
    at async processModule (<masked_path>mobileapp/node_modules/metro/src/DeltaBundler/graphOperations.js:279:3)
    at async addDependency

Screen Shot 2023-01-09 at 09 25 49

ottokruse commented 1 year ago

Also run into this issue.