15 November 2025
When attempting to run the iOS development server with bun run ios, the build failed with this error:
Error: Found config at /Users/waf/Documents/Projects/charades/metro.config.js
that could not be loaded with Node.js.This generic error message provided little insight into the actual problem.
The cryptic "could not be loaded" error was actually Metro's way of reporting that the NativeWind Metro plugin encountered an error during configuration loading. When Metro loads metro.config.js, it executes the withNativeWind() function, which validates the Tailwind configuration. If that validation fails, Metro reports it as a config loading error rather than surfacing the underlying issue.
The actual problem was in the tailwind.config.js file, which was missing two critical components required by NativeWind v4:
presets: [require("nativewind/preset")] Without the preset, the withNativeWind() function throws an error during Metro config initialization, resulting in the misleading "could not be loaded" message.
tailwind.config.jsBefore:
module.exports = {
content: [],
theme: {
extend: {},
},
plugins: [],
}After:
module.exports = {
content: [
"./app/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"./hooks/**/*.{js,jsx,ts,tsx}",
],
presets: [require("nativewind/preset")],
theme: {
extend: {},
},
plugins: [],
}The metro.config.js was already properly configured:
const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");
const config = getDefaultConfig(__dirname);
module.exports = withNativeWind(config, { input: "./global.tailwind.css" });If you're still experiencing issues after fixing the Tailwind configuration, check your Node.js version:
os.availableParallelism() function npx expo start --ios instead of bun run ios To check your Node version: node --version
To switch versions (if using nvm): nvm use 22
tailwind.config.js. This is a breaking change from v2/v3