`FileSystem.makeTempDirectory` crashes the program when it fails, instead of failing the task
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- backend
Línea de trabajo
Comienza con Gren/Kernel/FileSystem.js y ejecuta la reproducción enlazada en la issue con el gren.json y Main.gren mostrados. Sigue el callback de fallo de fs.mkdtemp y verifica que los fallos ya no provoquen un bloqueo al analizar una ruta undefined. Se considera terminado cuando Task.onError recibe un FileSystem.Error cuyo código refleja el fallo subyacente, como ENOENT o EPERM.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 13
- Forks
- 6
- Merge medio
- 4 d 10 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de gren-lang/node
-
`ChildProcess.spawn` with `NoShell` looks for a program named after the program and its argumentsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Todos los issues de gren-lang/node
Issues similares
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
amponce/archive-movie-browser#354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
saayam-for-all/webapp#1870 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Imageomics/OpenCite#66 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
chr15m/twiiit.com#20 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
antropos17/Aegis#629 ·
Los mantenedores suelen responder en 4 días