dillonkearns/elm-graphql

VerifyScalarCodecs trying to use unformatted elm files

sporto opened this issue · 4 comments

After upgrading to 4.03 elm make src/Elm/Api/VerifyScalarCodecs.elm --output=/dev/null started to fail.

-- UNFINISHED RECORD TYPE ------------------------------- src/Elm/Api/Scalar.elm

I was partway through parsing a record type, but I got stuck here:

29|     {codecDate : Codec valueDate

Inspecting the file I see:

defineCodecs :
    {codecDate : Codec valueDate
, codecId : Codec valueId
, codecJson : Codec valueJson
, codecTime : Codec valueTime}
    -> Codecs valueDate valueId valueJson valueTime

I format the file using elm-format manually everything is fine. So verifyCustomCodecsFileIsValid is being called using an unformatted file.

In here

applyElmFormat(prependBasePath("/", baseModule, outputPath));

I can see that elm format is called before verifyCustomCodecsFileIsValid But that file is not formatted. Maybe it needs more time to run?

Reverted to 4.0.2, still seeing this. Looking into it more.

Apparently Elm format 0.8.3 is what broke the build for us
7acbfe4#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

Uh, I downgraded Elm format in our package json. And then upgraded again to 0.8.3 and it formats fine now. 🤷 . All good now. Will close.

Very strange 🤔

Thanks for reporting, it's good to have a reference here in case others see anything like this.