leecade / leecade/react-native-swiper

Module error not working

Open
#1,290 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Windows 10 ?
Version

Which versions are you using:

  • react-native-swiper v 1.60 and 1.5.14?
  • react-native v0.64.2?.?
Expected behaviour

image slider swipe

Actual behaviour

[Error: InternalError Metro has encountered an error: While trying to resolve module react-native-swiper from file C:\ClientProjects\delivery360\src\screens\authScreens\SignInWelcomeScreen.js, the package C:\ClientProjects\delivery360\node_modules\react-native-swiper\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (C:\ClientProjects\delivery360\node_modules\react-native-swiper\index.js. Indeed, none of these files exist:

  • C:\ClientProjects\delivery360\node_modules\react-native-swiper\index.js(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • C:\ClientProjects\delivery360\node_modules\react-native-swiper\index.js\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx): C:\ClientProjects\delivery360\node_modules\metro\src\node-haste\DependencyGraph.js (436:17)

434 |
435 | if (error instanceof InvalidPackageError) {

436 | throw new PackageResolutionError({
| ^
437 | packageError: error,
438 | originModulePath: from,
439 | targetModuleName: to]
Error: While trying to resolve module react-native-swiper from file C:\ClientProjects\delivery360\src\screens\authScreens\SignInWelcomeScreen.js, the package C:\ClientProjects\delivery360\node_modules\react-native-swiper\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (C:\ClientProjects\delivery360\node_modules\react-native-swiper\index.js. Indeed, none of these files exist:

How to reproduce it>

To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.

Steps to reproduce

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking the package.json main entry for react-native-swiper and whether the referenced index.js exists in the installed package. Review the reported import from src/screens/authScreens/SignInWelcomeScreen.js and reproduce the Metro resolution error on Windows 10 with the listed React Native and package versions. Done means the package resolves successfully or the missing-package cause is documented with a reproducible example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.