const { getDefaultConfig } = require("expo/metro-config"); const path = require("path"); const projectRoot = __dirname; const workspaceRoot = path.resolve(projectRoot, ".."); const config = getDefaultConfig(projectRoot); // mobile/ is nested inside the OnlyPets repo and shares its root node_modules // for the type-only AppRouter import (see src/api/trpc.ts) — Metro's default // watchFolders only cover this project directory, so packages that only // exist in the root install (e.g. @trpc/server, transitively required by // @trpc/tanstack-react-query) otherwise fail to resolve. config.watchFolders = [workspaceRoot]; config.resolver.nodeModulesPaths = [ path.resolve(projectRoot, "node_modules"), path.resolve(workspaceRoot, "node_modules"), ]; module.exports = config;