Can't require image with spaces, etc. in filename
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, react-native
调研方向
从 metro/src/Assets.js 中的 getAbsoluteAssetRecord 和 getAsset 开始,以报告的堆栈跟踪作为入口。在 React Native 0.81 下使用包含空格的文件名重现 asset 请求,并将行为与 0.79 进行比较。当 asset 能够加载,且 ENOENT 路径不包含文件名的编码字符时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hi folks, I'm getting the same error seen in this very old RN issue:
https://github.com/facebook/react-native/issues/10364
Here is the stacktrace that shows this is ocurring in Assets.js
Error: ENOENT: no such file or directory, scandir '/Users/andrew/Work/Code/projects/Failure/Mobile/ReactNative/failure/.%2Fassets%2Fimages'
at Object.readdir (node:internal/fs/promises:956:18)
at getAbsoluteAssetRecord (/Users/andrew/Work/Code/projects/Failure/Mobile/ReactNative/failure/node_modules/@expo/metro/node_modules/metro/src/Assets.js:114:17)
at getAsset (/Users/andrew/Work/Code/projects/Failure/Mobile/ReactNative/failure/node_modules/@expo/metro/node_modules/metro/src/Assets.js:224:18)
at Server._processSingleAssetRequest (/Users/andrew/Work/Code/projects/Failure/Mobile/ReactNative/failure/node_modules/@expo/metro/node_modules/metro/src/Server.js:436:20)
at Server._processRequest (/Users/andrew/Work/Code/projects/Failure/Mobile/ReactNative/failure/node_modules/@expo/metro/node_modules/metro/src/Server.js:535:7)
I've confirmed that the file name had a space in it; when I renamed it to not have a space, it works just fine. Strangely, this did not happen in 0.79 of React Native; I recently upgraded to 0.81 of RN, and this happened. Though it says it's expo related, when forking this repo, the node_module file for Assets.js was the same as here, so I assume it's the correct repo.
- 主要语言
- JavaScript
- 星标
- 5.6k
- 派生
- 702
- 平均合并
- 2 天 20 小时
- 30 天内合并 PR
- 60
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react/metro 的其他 Issue
-
constant-folding-plugin emits 0/0 (NaN) for arithmetic on destructured bindings可能已有人在做 @cpruijsen 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 2 天内回复
-
难度 4/5 1-2 天 新手友好度 35/100
维护者通常 2 天内回复
-
[0.83.x] Backport micromatch removal and dotfile/multipart watcher fix together可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 2 天内回复
-
`dependencies is not iterable` / `Cannot read property 'reduce' of undefined`: `FileStore` serves zero-prefixed cache files as hits可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[BUG] npm pkg delete removes the first array item for a nonexistent property可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
-
feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 72/100
githubnext/gh-aw-workshop#4755 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
videojs/video.js#9537 · 1 条评论 ·
维护者通常 1 天内回复
-
fix
难度 1/5 1 小时以内 新手友好度 72/100
idean3885/claude-ops-agent#728 ·
维护者通常 1 天内回复