When using bun as the package manager, arbitrary value classes from node_modules dependencies (e.g., HeroUI Native) are silently dropped in production/preview builds while working perfectly in dev.
Environment: Uniwind ^1.2.2, Tailwind CSS ^4.1.18, Bun 1.3.3, Expo ~54.0.33, HeroUI Native 1.0.0-rc.2
Root Cause
Bun stores packages via symlinks:
node_modules/heroui-native → ../../../node_modules/.bun/heroui-native@1.0.0-rc.2.../node_modules/heroui-native
The @source "./node_modules/heroui-native/src" directive tells Tailwind's Oxide scanner to scan the package. The scanner follows the symlink but there's a path mismatch in .gitignore allowlist logic — the canonical path (under .bun/.../node_modules/) gets excluded by the node_modules gitignore rule, and the allowlist doesn't match.
Arbitrary value classes (h-[56px], p-[3px], border-[1.5px], etc.) that only exist in the library source are never generated.
Why Dev Works but Production Doesn't
- Dev: Uniwind's Metro JIT plugin generates styles at runtime. Oxide scanner not involved. All classes work.
- Production: CSS is pre-compiled via the Oxide scanner. Symlinked dependency is not scanned → library-only classes missing.
Workaround
@source "./node_modules/heroui-native/src";
@source inline("h-[36px] h-[48px] h-[56px] p-[3px] -my-[3px] py-[3px] top-[3px] w-[48px] h-[24px] left-[2px] w-[28px] h-[20px] right-[2px] p-[2px] pt-[3.5px] h-[6px] w-[6px] border-[1.5px]");
Fragile — requires updating on every library upgrade.
Upstream
Tracked at tailwindlabs/tailwindcss#17985.
Possible Uniwind-level mitigations
- Document the workaround for bun users
- Auto-generate safelist during production builds — scan resolved dependency sources at the JS level and emit
@source inline(...) transparently
- Resolve symlinks before passing to Oxide — if Uniwind controls
@source path resolution, resolve to canonical paths directly
Reproduction
- Expo + RN project with Uniwind, bun as package manager
- Install a library using Tailwind arbitrary values (
heroui-native)
- Add
@source "./node_modules/<package>/src" to global.css
- Build preview/production (
eas build --profile preview --local)
- Components with arbitrary classes have broken layouts
- Compare with dev where everything renders correctly
When using bun as the package manager, arbitrary value classes from
node_modulesdependencies (e.g., HeroUI Native) are silently dropped in production/preview builds while working perfectly in dev.Environment: Uniwind ^1.2.2, Tailwind CSS ^4.1.18, Bun 1.3.3, Expo ~54.0.33, HeroUI Native 1.0.0-rc.2
Root Cause
Bun stores packages via symlinks:
The
@source "./node_modules/heroui-native/src"directive tells Tailwind's Oxide scanner to scan the package. The scanner follows the symlink but there's a path mismatch in.gitignoreallowlist logic — the canonical path (under.bun/.../node_modules/) gets excluded by thenode_modulesgitignore rule, and the allowlist doesn't match.Arbitrary value classes (
h-[56px],p-[3px],border-[1.5px], etc.) that only exist in the library source are never generated.Why Dev Works but Production Doesn't
Workaround
Fragile — requires updating on every library upgrade.
Upstream
Tracked at tailwindlabs/tailwindcss#17985.
Possible Uniwind-level mitigations
@source inline(...)transparently@sourcepath resolution, resolve to canonical paths directlyReproduction
heroui-native)@source "./node_modules/<package>/src"toglobal.csseas build --profile preview --local)