Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Unable to resolve module when use typescript path

$
0
0

I modded the tsconfig to use with path with less annoying "../../.."

But when i mod the tsconfig i got this error

Unable to resolve module @assets/Icons/Logo2.svg from /Users/khanhs/Work/React-native/BHSoft/SafeApp/src/components/Header.tsx: @assets/Icons/Logo2.svg could not be found within the project or in these directories:  node_modules

Here is my tsconfig:

{"extends": "expo/tsconfig.base","compilerOptions": {"target": "es6","module": "commonjs","moduleResolution": "node","noResolve": false,"noImplicitAny": false,"removeComments": true,"sourceMap": true,"allowJs": true,"jsx": "react","paths": {"@src/*": ["./src/*"],"@assets/*": ["./assets/*"]    }  },"exclude": ["./node_modules/**/*"]}

Weirdly, when i click on tsconfig file, it show some error likeenter image description here

Please help, thank a lots


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>