`FileSystem.makeTempDirectory` crashes the program when it fails, instead of failing the task
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 86/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- backend
調査の方向性
Gren/Kernel/FileSystem.js から始め、示されている gren.json と Main.gren を使って issue にリンクされている再現手順を実行します。fs.mkdtemp の失敗コールバックを追跡し、undefined のパスを解析する際に失敗してもクラッシュしなくなっていることを確認します。Task.onError が、基盤となる失敗を反映した code(ENOENT や EPERM など)を持つ FileSystem.Error を受け取れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Found against: gren 0.6.6, gren-lang/core 7.4.2, gren-lang/node 6.1.3, node 22
Reproduction: https://github.com/gilramir/gren-bug-reports/tree/main/2026-09-14-maketempdirectory-failure
FileSystem.makeTempDirectory is a Task FileSystem.Error Path, but when node
cannot make the directory the program dies with The "path" argument must be of type string. Received undefined and the program's Task.onError never runs.
Expected: the task fails with an Error whose code is ENOENT (or EPERM, etc). Any failure
reaches it: a missing parent directory, a prefix naming a directory the user
cannot write, or a full temporary directory.
Reproduction
gren.json dependencies: gren-lang/core 7.4.2, gren-lang/node 6.1.3. Save as src/Main.gren. Build and run with gren make Main --output=app && node app:
module Main exposing (main)
import FileSystem
import FileSystem.Path as Path
import Init
import Node
import Stream
import Task
main : Node.SimpleProgram a
main =
Node.defineSimpleProgram <| \env ->
Init.await FileSystem.initialize <| \fs ->
Node.endSimpleProgram
(FileSystem.makeTempDirectory fs "no-such-directory/x"
|> Task.map (\path -> "made " ++ Path.toPosixString path)
|> Task.onError (\e -> Task.succeed ("failed: " ++ FileSystem.errorCode e))
|> Task.andThen (\line -> Stream.writeLineAsBytes line env.stdout)
|> Task.onError (\_ -> Task.succeed env.stdout)
)
Output:
$ node app
node:internal/errors:540
throw error;
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at Object.normalize (node:path:1309:5)
at _FilePath_parse (/path/to/app:2889:40)
at _FilePath_fromString (/path/to/app:2885:10)
at /path/to/app:3664:40
at FSReqCallback.oncomplete (node:fs:186:23) {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v22.23.2
Cause
Gren/Kernel/FileSystem.js:
fs.mkdtemp(path.join(os.tmpdir(), prefix), function (err, dir) {
if (err) {
callback(
__Scheduler_fail(
_FileSystem_constructError(__FilePath_fromString(dir), err),
),
);
On failure dir is undefined, and __FilePath_fromString(undefined) calls
path.normalize(undefined), which throws inside node's callback, where nothing
catches it.
- 主要言語
- JavaScript
- スター
- 13
- フォーク
- 6
- 平均マージ
- 4日 10時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gren-lang/node のほかの issue
-
`ChildProcess.spawn` with `NoShell` looks for a program named after the program and its argumentsオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
solana-foundation/solana-com#2202 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
yegor256/copyrights-action#216 ·
-
[BUG] onScroll never refreshes the window container's height after a vertical-only viewport resizeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
juliangarnier/anime#1192 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PedestrianDynamics/pyFDS-Evac#226 ·
メンテナーはふだん 1 日以内に返信