Native Metro transformer crashes on Expo's @expo/log-box CSS modules with Specifier deserialization error
维护者通常 3 天内回复
@danstepanov 已经在做这个了。
开始于 2026年7月15日。
评估
这个 Issue 还没有评估数据。
描述
Native Metro transformer crashes on Expo's @expo/log-box CSS modules with failed to deserialize; expected an object-like struct named Specifier
Summary
I hit a crash in react-native-css while following the Nativewind v5 setup on a fresh Expo 55 app.
The failure is triggered when Expo's own @expo/log-box CSS modules are sent through the native react-native-css Metro transformer. A direct compile of @expo/log-box/src/overlay/Overlay.module.css reproduces the same error outside Metro.
I do not think this is the same issue as CSS @property support. That appears to be covered separately by PR #284. This issue seems to be about react-native-css trying to compile framework-owned CSS that should be left to Expo's normal CSS handling.
Environment
expo:~55.0.5react-native:0.83.2nativewind:^5.0.0-preview.2react-native-css:^3.0.4- package manager:
bun - Node:
v25.7.0
Minimal reproduction
Published repro repo:
Fast repro:
bun install
bun run repro:logbox
Current output:
Compiling node_modules/@expo/log-box/src/overlay/Overlay.module.css with react-native-css...
Error: failed to deserialize; expected an object-like struct named Specifier, found ()
The reproduction app itself uses the simple documented Nativewind Metro setup:
const { getDefaultConfig } = require("expo/metro-config");
const { withNativewind } = require("nativewind/metro");
module.exports = withNativewind(getDefaultConfig(__dirname));
Additional context
Expo's @expo/log-box package appears to own its CSS handling already:
- it ships CSS modules under
@expo/log-box/src/overlay/*.module.css - it has its own
metro.config.js - it has a dedicated
shadowDomCssTransformer.js
Because react-native-css replaces Metro's transformer globally, these Expo overlay files end up going through the native CSS compile path instead.
Expected behavior
react-native-css should not try to compile Expo log-box CSS modules with the native compiler on iOS/Android. Those files should be passed through Expo's default CSS handling so Nativewind can coexist with Expo's error overlay.
Actual behavior
The native CSS compiler crashes with:
Error: failed to deserialize; expected an object-like struct named Specifier, found ()
Proposed direction
A small Metro-level bypass for node_modules/@expo/log-box/**/*.css seems like the safest fix:
- keep normal native compilation for app CSS and Nativewind input
- skip native compilation for Expo's log-box CSS
- delegate those files to the default Expo transformer
I have a local patch sketch for this if that direction sounds acceptable.
- 主要语言
- TypeScript
- 星标
- 166
- 派生
- 45
- 平均合并
- 13 天 14 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nativewind/react-native-css 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
nativewind/react-native-css#545 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nativewind/react-native-css#544 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nativewind/react-native-css#543 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
nativewind/react-native-css#540 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nativewind/react-native-css#538 ·
维护者通常 3 天内回复
查看 nativewind/react-native-css 的全部 Issue
相似的 Issue
-
bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 73/100
PhyberApex/kuroshiro#1687 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
microsoft/monaco-editor#5563 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 86/100
awslabs/visual-asset-management-system#937 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100