question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve path to module 'react-native-screens' (ESLint)

See original GitHub issue

Got this lint error in my VS Code:

Unable to resolve path to module 'react-native-screens'.eslint(import/no-unresolved)
module "react-native-screens"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:9

github_iconTop GitHub Comments

63reactions
skleeschultecommented, May 23, 2019

I fixed this issue by adding the extension .native.js to the eslint-import-resolver-node config in my .eslintrc file:

{
  "parser": "babel-eslint",
  "extends": "airbnb",
  "settings": {
    "import/resolver": {
      "node": {
        "extensions": [".js", ".jsx", ".json", ".native.js"]
      }
    }
  }
}

Explanation: The idea comes from benmosher’s comment at eslint-plugin-import. In my case, [".js", ".jsx", ".json"] is the default configuration for the node resolver extensions; this can be found out e.g. by running eslint --print-config index.js. (The eslint-import-resolver-node extensions for the default airbnb config are defined in eslint-config-airbnb/rules/react.js as ['.js', '.jsx', '.json']; eslint-config-airbnb adds rules for React by default: eslint-config-airbnb/index.js.) react-native-screens sets src/screens as main entry point in the package.json file. In the src-folder screens.native.js is the correct entry point for react-native, so adding .native.js to the list of resolver extensions fixes the problem.

45reactions
Jahanzai6commented, Feb 1, 2020

I resolve that error by simply npm install react-native-screens

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve path to module 'react-native-screens' ...
You need to install 3 more libs react-native-gesture-handler, react-native-reanimated, and react-native-screens in order to work with ...
Read more >
eslint/eslint - Gitter
I'm trying to setup eslint-plugin-import but I can't make it work xD ... 6:8 error Unable to resolve path to module '~/components' import/no-unresolved....
Read more >
unable to resolve module react-native-screens
Unable to resolve path to module 'react-native-screens'.eslint(import/no-unresolved) module "react-native-screens". Open side panel.
Read more >
[Solved]-Unable to resolve path to module 'react-native- ...
Coding example for the question Unable to resolve path to module 'react-native-screens' (ESLint)-React Native.
Read more >
ESLint Unable to resolve path to module
Visual Studio 2022 shows errors for tsconfig paths when it's actually ... (ESLint) import/no-unresolved Unable to resolve path to module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found