Posts

Showing posts with the label Metro Bundler

Fixing React Native Path Alias Error: Unable to Resolve Module @/app/App

Image
Fixing React Native Path Alias Error: Unable to Resolve Module @/app/App The Problem If you're using path aliases (like @/ ) in your React Native project, you might encounter this frustrating error: ERROR Error: Unable to resolve module @/app/App from /path/to/project/index.ts: @/app/App could not be found within the project or in these directories: node_modules ../node_modules This happens even when your TypeScript configuration is correct and your IDE shows no errors. What's going on? Why This Happens The issue occurs because TypeScript and Metro (React Native's bundler) are two separate systems : TypeScript understands your path aliases through tsconfig.json Metro (the bundler) has no idea about these aliases unless you explicitly configure it Your IDE might show everything is fine because it use...