plugin-rsc: inject-async-local-storage transform drops source maps
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- build-system, tooling
调研方向
从 plugin-rsc 包中的 globalAsyncLocalStoragePlugin 开始,使用 npm ci 和 npm run repro 运行链接的复现。跟踪 rsc:inject-async-local-storage 转换并确定合适的测试位置。完成的标准是:转换后的模块保留源映射,标记解析为 src/entry.js:6,并且 SOURCEMAP_BROKEN 警告消失。
由索引模型根据 Issue 内容生成。
描述
Related plugins
Describe the bug
The rsc:inject-async-local-storage transform changes modules containing both typeof AsyncLocalStorage and new AsyncLocalStorage(), but it does not return a source map for that transformation.
With Vite 8.2.1, the RSC and SSR builds emit SOURCEMAP_BROKEN naming this transform. The final emitted map cannot resolve a marker in the transformed source to any original position: the expected location is src/entry.js:6, while originalPositionFor returns source=null, line=null, column=null.
Expected: the transform preserves and composes source mappings, the marker resolves to src/entry.js:6, and Vite emits no source-map warning for this transform.
Actual: the transformed module loses its original mapping. This can cause incorrect or missing stack-frame symbolication in production error monitoring.
The likely location is globalAsyncLocalStoragePlugin, which prepends initialization text and returns only transformed code. I can submit a patch and test if maintainers confirm the preferred test location.
Reproduction
https://github.com/FieldArchiveTX/vite-plugin-rsc-sourcemap-repro
Steps to reproduce
- Clone the reproduction repository.
- Run
npm ci. - Run
npm run repro. - Observe two
SOURCEMAP_BROKENwarnings forrsc:inject-async-local-storageand the verifier output showing a null original position.
The reproduction command exits successfully when the defect is reproduced.
System Info
System:
OS: Windows 11 10.0.26200
CPU: x64 Intel Core i7-14700KF
Binaries:
Node: 24.14.0
npm: 10.9.2
Browsers:
Chrome: 150.0.7871.187
npmPackages:
@vitejs/plugin-rsc: 0.5.34
vite: 8.2.1
react: 19.2.8
react-dom: 19.2.8
react-server-dom-webpack: 19.2.8
Used Package Manager
npm
Logs
[plugin rsc:inject-async-local-storage] [SOURCEMAP_BROKEN]
Sourcemap is likely to be incorrect: a plugin (rsc:inject-async-local-storage) was used to transform files, but didn't generate a sourcemap for the transformation.
expected: src/entry.js:6
traced: source=null, line=null, column=null
REPRODUCED: the emitted source map does not resolve the marker to its source line.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 287
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vitejs/vite-plugin-react 的其他 Issue
-
plugin-rsc: a client reference's CSS is linked before the CSS of the chunks it imports (build)可能已有人在做 @wozhenbang2004 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
vitejs/vite-plugin-react#1570 ·
维护者通常 1 天内回复
-
pending triage
难度 4/5 3-5 天 新手友好度 35/100
vitejs/vite-plugin-react#1581 ·
维护者通常 1 天内回复
-
[plugin-rsc] Build exits 0, but the app fails at runtime: a server action imported only by browser code is missing from the RSC build可能已有人在做 @NeilPant 于 4 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
vitejs/vite-plugin-react#1578 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
vitejs/vite-plugin-react#1577 ·
维护者通常 1 天内回复
-
[plugin-rsc] inline "use server" function declarations lose hoisting and throw TDZ ReferenceError可能已有人在做 @draarivpatel-ui 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
vitejs/vite-plugin-react#1566 · 1 条评论 ·
维护者通常 1 天内回复
查看 vitejs/vite-plugin-react 的全部 Issue
相似的 Issue
-
good first issue help wanted
难度 2/5 1 小时以内 新手友好度 86/100
Intelligenza-Umana/intelligenza-umana-web#16 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
open-webui/open-webui#35184 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
danielmiessler/LifeOS#3001 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复