RORK LABJP
TOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the roundTOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the round
Articles/Dev Tools
Dev Tools/2026-05-03Beginner

5 Things to Check First When Rork Shows 'Unable to Resolve Module'

Walk through the five most common causes of the 'Unable to resolve module' error in Rork, React Native, and Expo projects, with the exact commands and the order in which to check them.

Troubleshooting38Metro4React Native209Expo149Beginner7

You ask Rork to add a new screen, run npx expo start, and the dev server greets you with a red screen:

Unable to resolve module xxx from /path/to/file.tsx

It looks intimidating the first few times, but the underlying causes fall into a small handful of buckets. After hitting this error many times while iterating on Rork-generated code, I've settled on a fixed checking order that gets me back to writing features within minutes. Here it is, with the exact commands I keep in muscle memory.

Why this error happens

Metro, the React Native bundler, walks every import statement in your code to build the dependency graph for your app. The moment it can't locate a file or package referenced by an import, it stops and throws "Unable to resolve module."

A useful detail to internalize: Metro reports both missing npm packages and missing local files with the same message. Whether the failing import is import { Camera } from "expo-camera" or import { Header } from "../components/Header", the error text looks identical. The path that comes after from in the error message is your starting point for narrowing down the cause—open that file first and look at the import line that doesn't resolve.

Another thing worth knowing: Metro runs entirely independently from TypeScript. Even if tsc is happy with your imports, Metro can still fail. Treating "the type checker passes" as "the bundle will succeed" is a frequent source of false confidence, especially in projects where Rork has just added a new dependency.

1. The package isn't installed

This is by far the most common case—and a natural side effect of how Rork works. The AI generated code referencing a library that isn't yet in your package.json. Because the AI is shaping your codebase based on the prompt rather than auditing your dependency list, new imports often show up faster than the corresponding installs.

# What the error looks like
Unable to resolve module react-native-reanimated from src/screens/Home.tsx
# The fix
npx expo install react-native-reanimated

The key here is using npx expo install instead of plain npm install. The Expo CLI picks the version that matches your installed Expo SDK, which prevents a whole class of follow-up build errors. Packages that Rork tends to pull in—expo-image, expo-blur, react-native-svg, react-native-reanimated, expo-haptics—are usually one command away once you spot which one is missing.

If you're not sure which package is missing, the import statement itself is the answer. Look at the file mentioned in the error, find the import for the unresolved module name, and run npx expo install against that exact name. For scoped packages (like @react-native-async-storage/async-storage), include the scope.

2. Metro's cache is stale

If the package is in package.json and clearly installed, but the error still shows up, Metro is almost certainly serving you a stale cache. This commonly happens right after adding a dependency or switching git branches.

# Clear the cache and restart
npx expo start -c
 
# If that doesn't fix it, also wipe the deeper caches
rm -rf node_modules/.cache
watchman watch-del-all
npx expo start -c

The -c flag clears Metro's transformer and haste-map caches in one go. After any large rewrite by the Rork AI, I've made it a habit to start with -c for the first run. It saves a surprising amount of "wait, why isn't this working?" time.

If you're on a CI machine or a hosted build like EAS, the equivalent is to invalidate the build cache from the Expo dashboard or to bump a version field that triggers a fresh install. Metro caches don't follow code through CI in the way local caches do, so cache problems there usually mean stale node_modules, not stale Metro state.

3. Typos and case mismatches in the import path

Most macOS dev machines run on a case-insensitive filesystem, but EAS Build, CI, and parts of the iOS simulator's caches are case-sensitive. The classic symptom: it works on your laptop, then fails the moment you submit a build.

// Bad — file is Header.tsx but imported in lowercase
import { Header } from "./components/header";
 
// Good — exact case match
import { Header } from "./components/Header";

Extension mistakes happen too. Maybe you wrote ./utils/format thinking it pointed at a folder's index.ts, when in fact there's a file called format.ts. Use the path printed after from as your starting line, and reopen the importing file via your editor's go-to-definition. Mismatches usually become obvious within seconds.

A small habit that helps: when Rork generates a new file, glance at the import section before running it. If you see imports that don't match what you'd type by hand—weird casing, mixed quotes, missing extensions—fix them up front rather than waiting for Metro to surface the issue.

4. You forgot to teach the path alias to Babel/Metro

If you set "paths" in tsconfig.json so you can write things like @/components/Button, TypeScript will stop complaining—but Metro won't know about the alias unless you also configure Babel. TypeScript and Metro use entirely separate path resolution systems, and forgetting one is a textbook cause of the resolve error.

// babel.config.js
module.exports = function (api) {
  api.cache(true);
  return {
    presets: ["babel-preset-expo"],
    plugins: [
      [
        "module-resolver",
        {
          root: ["./"],
          alias: {
            "@": "./src",
          },
        },
      ],
    ],
  };
};

After installing babel-plugin-module-resolver, restart Metro with the cache flag. Just adding the plugin without a fresh cache won't fix it because the old transformations are still being served.

If you'd rather avoid maintaining the Babel side of this configuration, an alternative is to keep all imports relative and skip the alias entirely. With a tidy folder structure, ../components/Button is rarely worse than @/components/Button in practice, and you cut out an entire failure mode.

5. You're running a native module on Expo Go

Libraries like react-native-vision-camera and react-native-mmkv ship native code that Expo Go doesn't have bundled. Metro tries to resolve them, fails to find the prebuilt binary, and throws this error. This is one of the trickier cases because the error message looks like a missing dependency, but installing the package won't fix it.

The fix is to switch to a Development Build:

# Create a development build
npx expo prebuild --clean
npx expo run:ios   # or run:android

You can also tell Rork to regenerate the screen with a "no native modules" constraint. In practice I prefer staying on Expo Go for the prototyping phase and only flipping to a Development Build once the feature scope is locked in—it keeps the iteration loop fast and the friction of fresh native builds out of the way until you actually need them.

A quick way to check if a library needs a Development Build is to look at its README. Anything that says "Custom Development Client required" or mentions iOS/Android-specific setup steps falls into this category. Pure-JS libraries like axios, zustand, or date-fns will never trigger this case.

The checking order in one place

When you see this error, walking down the list in order is usually the fastest path to a fix:

  1. Is the package in package.json? → If not, npx expo install
  2. Is Metro's cache fresh? → npx expo start -c
  3. Is the import path spelled correctly? (case, extensions, file vs folder)
  4. If you're using a path alias like @/, is Babel configured for it?
  5. If it's a native module, are you on a Development Build instead of Expo Go?

If you want a single sanity-check to run before each new dev session, npx expo doctor is worth knowing about. It scans your project for common dependency-version mismatches and Expo SDK incompatibilities that tend to surface as resolve errors later. Running it once after a Rork code generation can catch issues before Metro even gets to complain.

Once this order becomes muscle memory, you can keep moving even when Rork generates code with a new dependency. If you want to deepen your Metro debugging skills further, Troubleshooting Metro Bundler and Fast Refresh in Rork and Fixing Runtime Errors in Rork-Generated Code cover the build-time and runtime sides of this same picture.

One last note worth keeping in mind: when you fix one of these issues, restart Metro fully rather than relying on hot reload. Module resolution decisions get cached aggressively, and a fresh start ensures the next failure (if there is one) reflects the current state of your code rather than a half-applied fix.

Next time you hit this error, try npx expo install followed by npx expo start -c first. In my experience that single combination clears 70–80% of cases before you need to dig any further into aliases, builds, or import paths.

Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Dev Tools2026-04-24
Diagnosing Metro Bundler Freezes and Broken Fast Refresh in Rork Apps
When your Rork-generated Expo app stops picking up code changes or Metro freezes mid-bundle, here is the diagnostic order and the safe reset steps that actually work.
Dev Tools2026-07-08
Your SVG Icon Shows in Expo Go but Vanishes in a Build — Making SVGs Render Reliably in Rork Apps
When a .svg import renders nothing, throws a resolve error, or ignores your theme colors in Rork and Expo apps, here is how to fix it with metro.config.js, react-native-svg-transformer, and currentColor — with working code.
Dev Tools2026-06-01
Fixing 'JavaScript heap out of memory' in Metro and EAS Builds
Your Rork or Expo build dies with 'FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory.' Here is why it happens and exactly how to fix it, both locally and on EAS Build.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →