Skip to content

Bug?: Confusing behaviour when combining --optimize with --output=/dev/null #2324

Description

@dave4420

Setup:

src/Main.elm:

module Main exposing (main)

main : Program () () ()
main = Debug.todo "eventually"

I run elm make src/Main.elm --optimize --output=/dev/null.

Expected behaviour

The compiler gives me an error (including exiting with a non-zero status code), just as it would if I had specified --output=some.js.

Actual behaviour

The compiler prints Success! to stdout and exits with status 0.

Versions

  • Elm: 0.19.1
  • Operating System: macOS Sonoma 14.4.1

Additional Details

This appears to be caused by the compiler not generating code when given --output=/dev/null, and therefore not checking whether the Debug module is used.

An alternative would be to output a message in this case saying that --optimize --output=/dev/null does not check that --optimize --output=some-file.js would succeed, only that the source code typechecks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions