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

Typescript Error 2307 for relative imports

$
0
0

I am receiving an error when trying to use relative imports in my React Native expo project:Cannot find module 'constants/Colors' or its corresponding type declarations.ts(2307)

My app compiles but I still get this TS error.

here is my tsconfig:

"baseUrl": ".","extends": "expo/tsconfig.base","compilerOptions": {"strict": true  },"paths": {"components/*": ["components/*"],"constants/*": ["constants/*"]  }}

Any suggestions appreciated!

Neither SO or chatGPT have helped.I have tried deleting node_modules & running npm i, I have restarted TS server and my config seems right. My files are definitely in the right place and typed right.


Viewing all articles
Browse latest Browse all 6581

Latest Images

Trending Articles



Latest Images