Skip to content

Error reading stdin with gren run #341

@blaix

Description

@blaix

This program:

module Main exposing (main)

import Node
import Stream
import Stream.Log
import Task

main =
    Node.defineSimpleProgram <| \env ->
        Stream.readBytesAsString env.stdin
            |> Task.mapError (Debug.log "Read stream error")
            |> Task.onError (\_ -> Task.succeed "")
            |> Task.andThen (Stream.Log.line env.stdout)
            |> Node.endSimpleProgram

Executes correctly when compiled and run:

❯ gren make Main
Success! Compiled 1 module.

    Main ───> app

❯ node app
test
test

But errors when run with gren run:

❯ gren run Main
test
Something went wrong when communicating with compiler backend: Cancelled:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions