H
Hono2mo ago
JirkaB

React Native / Expo

Hello i have Monorepo expo app and i want to use hono rpc client in my react app but if i try import it with this metro config i get this error
const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");
const {
wrapWithReanimatedMetroConfig,
} = require("react-native-reanimated/metro-config");
const path = require("path");

// Find the project and workspace directories
const projectRoot = __dirname;
const monorepoRoot = path.resolve(projectRoot, "../../");

// Používáme pouze NativeWind bez Reanimated Metro konfigurace
const config = getDefaultConfig(projectRoot);

config.watchFolders = [monorepoRoot];

config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(monorepoRoot, "node_modules"),
];

module.exports = wrapWithReanimatedMetroConfig(
withNativeWind(config, { input: "./src/global.css" })
);
const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");
const {
wrapWithReanimatedMetroConfig,
} = require("react-native-reanimated/metro-config");
const path = require("path");

// Find the project and workspace directories
const projectRoot = __dirname;
const monorepoRoot = path.resolve(projectRoot, "../../");

// Používáme pouze NativeWind bez Reanimated Metro konfigurace
const config = getDefaultConfig(projectRoot);

config.watchFolders = [monorepoRoot];

config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(monorepoRoot, "node_modules"),
];

module.exports = wrapWithReanimatedMetroConfig(
withNativeWind(config, { input: "./src/global.css" })
);
4 Replies
JirkaB
JirkaBOP2mo ago
And when i set unstableExports to false expo app is unable to find hono/client module
ambergristle
ambergristle2mo ago
fwiw, this seems like more of a ReactNative issue than anything to do w hono
JirkaB
JirkaBOP2mo ago
yes thats probably true but i want know if anyone has the same problem so sorry for offtopic :[
ambergristle
ambergristle2mo ago
it's all good. you're welcome to post here. you might get better support elsewehere though

Did you find this page helpful?