Symptom
Any vxrn project that has nativewind v5 installed in node_modules (even if vxrn isn't actively using it - e.g. a transitive dep, or a sibling workspace's dep) fails to boot vite with:
ERROR "./jsx-dev-runtime" is not exported under the conditions ["vxrn-web", "import"] from package /…/node_modules/nativewind
The dev server never comes up.
Root cause
packages/vxrn/src/config/getOptimizeDeps.ts (lines 7-14 on main @ 993f36a) unconditionally lists nativewind subpaths in the needsInterop array:
const needsInterop = [
'nativewind/jsx-dev-runtime',
'nativewind/jsx-runtime',
'nativewind',
'react-native-css-interop/jsx-runtime',
'react-native-css-interop/jsx-dev-runtime',
'react-native-css-interop',
...
]
NativeWind v5 (5.0.0-preview.4 and later) dropped the jsx-dev-runtime / jsx-runtime subpath exports. Its package.json exports field now only declares:
['.', './babel', './metro', './types', './theme']
Because vxrn passes these entries to vite's optimizeDeps, vite tries to resolve nativewind/jsx-dev-runtime against the installed package and hits the export-conditions check, which throws and kills startup.
Reproduction
- Any vxrn / one project
- Add
nativewind@5 anywhere reachable in node_modules (direct dep, transitive, or even a sibling workspace package - vite still resolves it from the project root)
vxrn dev / one dev -> error above, server never starts
Workaround
Remove nativewind from node_modules (e.g. mv node_modules/nativewind /tmp/). Confirmed working - dev server boots immediately.
Suggested fix
Either:
(a) Wrap the nativewind entries in a resolve guard - only include subpaths that actually resolve, e.g. check the installed nativewind/package.json exports map before adding jsx-dev-runtime / jsx-runtime. Same pattern could apply to react-native-css-interop.
(b) Detect the installed nativewind major from node_modules/nativewind/package.json at config-init time. For v5+, only include 'nativewind' (or drop entirely if v5 no longer needs interop pre-bundling at all - the CSS-interop story changed).
(a) is more robust against future similar drops in either package.
Context
Hit this in the tamagui monorepo - cc @natew. Happy to PR if a direction is preferred.
Symptom
Any vxrn project that has
nativewindv5 installed innode_modules(even if vxrn isn't actively using it - e.g. a transitive dep, or a sibling workspace's dep) fails to boot vite with:The dev server never comes up.
Root cause
packages/vxrn/src/config/getOptimizeDeps.ts(lines 7-14 on main @ 993f36a) unconditionally lists nativewind subpaths in theneedsInteroparray:NativeWind v5 (
5.0.0-preview.4and later) dropped thejsx-dev-runtime/jsx-runtimesubpath exports. Itspackage.jsonexportsfield now only declares:Because vxrn passes these entries to vite's
optimizeDeps, vite tries to resolvenativewind/jsx-dev-runtimeagainst the installed package and hits the export-conditions check, which throws and kills startup.Reproduction
nativewind@5anywhere reachable innode_modules(direct dep, transitive, or even a sibling workspace package - vite still resolves it from the project root)vxrn dev/one dev-> error above, server never startsWorkaround
Remove
nativewindfromnode_modules(e.g.mv node_modules/nativewind /tmp/). Confirmed working - dev server boots immediately.Suggested fix
Either:
(a) Wrap the nativewind entries in a resolve guard - only include subpaths that actually resolve, e.g. check the installed
nativewind/package.jsonexportsmap before addingjsx-dev-runtime/jsx-runtime. Same pattern could apply toreact-native-css-interop.(b) Detect the installed
nativewindmajor fromnode_modules/nativewind/package.jsonat config-init time. For v5+, only include'nativewind'(or drop entirely if v5 no longer needs interop pre-bundling at all - the CSS-interop story changed).(a) is more robust against future similar drops in either package.
Context
Hit this in the tamagui monorepo - cc @natew. Happy to PR if a direction is preferred.