Skip to content

gren make fails with gren: DecodeProblem with duplicated module in lower case file #343

@dkoontz

Description

@dkoontz

Gren version tested: 0.6.0 and 0.6.1
OS: MacOS 15.5 (Apple silicon)
Node: 24.4.1

Given this file Main.gren

module Main exposing (main)

import Init
import Node
import Node exposing (Environment, Program)
import Task


main : Program Model Msg
main =
    Node.defineProgram
        { init = init
        , update = update
        , subscriptions = subscriptions
        }


type alias Model =
    {  }


type Msg
    = NoOp


init : Environment -> Init.Task { model : Model, command : Cmd Msg }
init env =
        Node.startProgram
            { model = {}
            , command = Cmd.none
            }


update : Msg -> Model -> { model : Model, command : Cmd Msg }
update msg model =
    { model = model, command = Cmd.none }

subscriptions : Model -> Sub Msg
subscriptions model =
    Sub.none

Here are the steps:

$ gren make Main
Success! Compiled 1 module.

    Main ───> app
$ cp Main.gren other.gren
$ gren make Main
gren: DecodeProblem "{\"command\":\"make\",\"optimize\":false,\"sourcemaps\":false,\"output\":null,\"report-json\":false,\"project-path\":\"/Users/david/dev/gren-test\",\"entry-points\":[\"Main\"],\"project-outline\":{\"type\":\"application\",\"platform\":\"node\",\"source-directories\":[\"src\"],\"gren-version\":\"0.6.1\",\"dependencies\":{\"direct\":{\"gren-lang/core\":\"7.0.0\",\"gren-lang/node\":\"6.0.0\",\"gren-lang/url\":\"6.0.0\"},\"indirect\":{}}},\"sources\":{\"Main\":{\"path\":\"/Users/david/dev/gren-test/src/Main.gren\",\"data\":\"module Main exposing (main)\\n\\nimport Init\\nimport Node\\nimport Node exposing (Environment, Program)\\nimport Task\\n\\n\\nmain : Program Model Msg\\nmain =\\n    Node.defineProgram\\n        { init = init\\n        , update = update\\n        , subscriptions = subscriptions\\n        }\\n\\n\\ntype alias Model =\\n    {  }\\n\\n\\ntype Msg\\n    = NoOp\\n\\n\\ninit : Environment -> Init.Task { model : Model, command : Cmd Msg }\\ninit env =\\n        Node.startProgram\\n            { model = {}\\n            , command = Cmd.none\\n            }\\n\\n\\nupdate : Msg -> Model -> { model : Model, command : Cmd Msg }\\nupdate msg model =\\n    { model = model, command = Cmd.none }\\n\\nsubscriptions : Model -> Sub Msg\\nsubscriptions model =\\n    Sub.none\\n\"},\"other\":{\"path\":\"/Users/david/dev/gren-test/src/other.gren\",\"data\":\"module Main exposing (main)\\n\\nimport Init\\nimport Node\\nimport Node exposing (Environment, Program)\\nimport Task\\n\\n\\nmain : Program Model Msg\\nmain =\\n    Node.defineProgram\\n        { init = init\\n        , update = update\\n        , subscriptions = subscriptions\\n        }\\n\\n\\ntype alias Model =\\n    {  }\\n\\n\\ntype Msg\\n    = NoOp\\n\\n\\ninit : Environment -> Init.Task { model : Model, command : Cmd Msg }\\ninit env =\\n        Node.startProgram\\n            { model = {}\\n            , command = Cmd.none\\n            }\\n\\n\\nupdate : Msg -> Model -> { model : Model, command : Cmd Msg }\\nupdate msg model =\\n    { model = model, command = Cmd.none }\\n\\nsubscriptions : 

... hundreds of lines elided...

(Q.Parser c) (Q.Parser d) =\\n  Q.Parser <| \\\\dict ->\\n    func (a dict) (b dict) (c dict) (d dict)\\n\\n\\n\\n{-|-}\\nmap5 : (a -> b -> c -> d -> e -> result) -> Parser a -> Parser b -> Parser c -> Parser d -> Parser e -> Parser result\\nmap5 func (Q.Parser a) (Q.Parser b) (Q.Parser c) (Q.Parser d) (Q.Parser e) =\\n  Q.Parser <| \\\\dict ->\\n    func (a dict) (b dict) (c dict) (d dict) (e dict)\\n\\n\\n{-|-}\\nmap6 : (a -> b -> c -> d -> e -> f -> result) -> Parser a -> Parser b -> Parser c -> Parser d -> Parser e -> Parser f -> Parser result\\nmap6 func (Q.Parser a) (Q.Parser b) (Q.Parser c) (Q.Parser d) (Q.Parser e) (Q.Parser f) =\\n  Q.Parser <| \\\\dict ->\\n    func (a dict) (b dict) (c dict) (d dict) (e dict) (f dict)\\n\\n\\n\\n{-|-}\\nmap7 : (a -> b -> c -> d -> e -> f -> g -> result) -> Parser a -> Parser b -> Parser c -> Parser d -> Parser e -> Parser f -> Parser g -> Parser result\\nmap7 func (Q.Parser a) (Q.Parser b) (Q.Parser c) (Q.Parser d) (Q.Parser e) (Q.Parser f) (Q.Parser g) =\\n  Q.Parser <| \\\\dict ->\\n    func (a dict) (b dict) (c dict) (d dict) (e dict) (f dict) (g dict)\\n\\n\\n\\n{-| If you need higher than eight, you can define a function like this:\\n\\n    apply : Parser a -> Parser (a -> b) -> Parser b\\n    apply argParser funcParser =\\n      map2 (<|) funcParser argParser\\n\\nAnd then you can chain it to do as many of these as you would like:\\n\\n    map func (string \\\"search\\\")\\n      |> apply (int \\\"page\\\")\\n      |> apply (int \\\"per-page\\\")\\n\\n-}\\nmap8 : (a -> b -> c -> d -> e -> f -> g -> h -> result) -> Parser a -> Parser b -> Parser c -> Parser d -> Parser e -> Parser f -> Parser g -> Parser h -> Parser result\\nmap8 func (Q.Parser a) (Q.Parser b) (Q.Parser c) (Q.Parser d) (Q.Parser e) (Q.Parser f) (Q.Parser g) (Q.Parser h) =\\n  Q.Parser <| \\\\dict ->\\n    func (a dict) (b dict) (c dict) (d dict) (e dict) (f dict) (g dict) (h dict)\\n\"}}}}" (Field "sources" (Failure (Region (Position 1 1195) (Position 1 1200)) InvalidInput))
CallStack (from HasCallStack):
  error, called at terminal/Main.hs:30:13 in gren-0.6.1-inplace-gren:Main
$ mv other.gren Other.gren
$ gren make Main
Success! Compiled 1 module.

    Main ───> app

So it only happens when the other module is named with a lower case file name.

Full output of failing command is attached.

log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions