{"action":"opened","issue":{"url":"https://api.github.com/repos/elm-lang/elm-make/issues/134","repository_url":"https://api.github.com/repos/elm-lang/elm-make","labels_url":"https://api.github.com/repos/elm-lang/elm-make/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/elm-make/issues/134/comments","events_url":"https://api.github.com/repos/elm-lang/elm-make/issues/134/events","html_url":"https://github.com/elm-lang/elm-make/issues/134","id":191877190,"number":134,"title":"[0.18] Json.Decode used but not included in compiled JS","user":{"login":"pauldijou","id":1275293,"avatar_url":"https://avatars.githubusercontent.com/u/1275293?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldijou","html_url":"https://github.com/pauldijou","followers_url":"https://api.github.com/users/pauldijou/followers","following_url":"https://api.github.com/users/pauldijou/following{/other_user}","gists_url":"https://api.github.com/users/pauldijou/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldijou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldijou/subscriptions","organizations_url":"https://api.github.com/users/pauldijou/orgs","repos_url":"https://api.github.com/users/pauldijou/repos","events_url":"https://api.github.com/users/pauldijou/events{/privacy}","received_events_url":"https://api.github.com/users/pauldijou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-27T18:44:56Z","updated_at":"2016-11-27T18:44:56Z","closed_at":null,"body":"I hope I'm not missing something but I created a really small Elm program with flags. It looks like the resulting JS code is using `_elm_lang$core$Json_Decode` to decode all flags. But my code does not import `Json.Decode`, so it's not included in the compiled JS file, resulting in a runtime exception: `ReferenceError: _elm_lang$core$Json_Decode$andThen is not defined`\r\n\r\nI'm pretty sure I didn't have the problem in Elm 0.17\r\n\r\n## Elm code\r\n\r\n```elm\r\nmodule Bug exposing (main)\r\n\r\ntype Msg = Noop\r\ntype alias Model = Float\r\ntype alias Flags = { start: Float }\r\n\r\nmain: Program Flags Model Msg\r\nmain =\r\n  Platform.programWithFlags\r\n    { init = (\\flags -> flags.start ! [])\r\n    , update = (\\msg model -> model ! [])\r\n    , subscriptions = (always Sub.none)\r\n    }\r\n```\r\n\r\n## Compiled JavaScript\r\n\r\n```javascript\r\n// Elm runtime but without Json_Decode\r\n// ...\r\n\r\nvar _user$project$Bug$main = _elm_lang$core$Platform$programWithFlags(\r\n  {\r\n    init: function (flags) {\r\n      return A2(\r\n        _elm_lang$core$Platform_Cmd_ops['!'],\r\n        flags.start,\r\n        {ctor: '[]'});\r\n    },\r\n    update: F2(\r\n      function (msg, model) {\r\n        return A2(\r\n          _elm_lang$core$Platform_Cmd_ops['!'],\r\n          model,\r\n          {ctor: '[]'});\r\n      }),\r\n    subscriptions: _elm_lang$core$Basics$always(_elm_lang$core$Platform_Sub$none)\r\n  })(\r\n  A2(\r\n    _elm_lang$core$Json_Decode$andThen, // <---- This will crash at runtime\r\n    function (start) {\r\n      return _elm_lang$core$Json_Decode$succeed(\r\n        {start: start});\r\n    },\r\n    A2(_elm_lang$core$Json_Decode$field, 'start', _elm_lang$core$Json_Decode$float)));\r\n```"}}
{"actor":{"display_login":"pauldijou"}}