elm-community / elm-time

A pure Elm date and time library.

Home Page:http://package.elm-lang.org/packages/elm-community/elm-time/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1.0.11 & 1.0.12 versions produce compilation error

playpauseandstop opened this issue · comments

My elm-package.json contains,

        "elm-community/elm-time": "1.0.8 <= v < 2.0.0",

dependency.

I needed to run elm-package install on new machine and after installation is done, elm-make failed with,

ERROR in ./static/elm/Main.elm
Module build failed: Error: Compiler process exited with error Compilation failed
Problem in dependency elm-community/parser-combinators 1.1.0

The elm-package.json constraints of 'elm-community/parser-combinators' are probably
letting too much stuff through. Definitely open an issue on the relevant github
repo to get this fixed and save other people from this pain.

In the meantime, take a look through the direct dependencies of the broken
package and see if any of them have had releases recently. If you find the new
thing that is causing problems, you can artificially constrain things by adding
some extra constraints to your elm-package.json as a stopgap measure.


Detected errors in 1 module.

After quick investigation I fixed my build by setting dependency as,

        "elm-community/elm-time": "1.0.8 <= v < 1.0.11",

so after elm-package install run 1.0.10 version installed and elm-make runs OK.


ps. Adding elm-community/parser-combinators: "1.1.0 <= v < 2.0.0" to dependencies didn't fix my build.

The infix operators in parser-combinators that are in conflict with some other package you are using. Unfortunately infix operator definitions in Elm are globally scoped, and I believe in the future they will be disallowed in library code entirely, limited only to core packages or something like that.

In the meantime, using parser-combinators is a bit of a time bomb. See for instance these closed issues: https://github.com/elm-community/parser-combinators/issues?utf8=%E2%9C%93&q=is%3Aissue+infix

It's something that needs to be raised more widely, whether parser-combinators should be fixed or whether elm-time should depend on another parser library, or both.

@playpauseandstop thanks for your alert. I'll take a look this evening to see what the exposure is on versions 1.0.11 and 1.0.12.

@ericgj thanks for jumping in; I would have thrashed around some trying to figure this out.

@ericgj & @oldfartdeveloper

Thanks for your help.

Looks like as of now only way is continue using 1.0.9 version of elm-time (as 1.0.10 version in my code results in some weird bug after compilation to JS).

Should I close the issue, or you ok for keeping it?

That's odd, but almost certainly related to the change in #45. Perhaps the inverse is happening to you -- do you depend on Bogdanp/parser-combinators (either directly or through another dependency), instead of elm-community/parser-combinators?

FWIW, raising the issue on slack, Illias and Evan recommended switching to elm-tools/parser instead of parser-combinators, as parser-combinators will probably not be upgraded for 0.19.

I've started branch 'issue-49' to perform the elm-tools/parser replacement. Hope to have it done this weekend.

In the meantime, have upgraded (and published) existing elm-time to use version 2.0.0 of elm-community/parser-combinators.

Just a quick update

Unfortunately after updating to,

        "elm-community/elm-time": "1.0.14 <= v < 2.0.0",

in elm-package.json, elm-make build still failed with,

Module build failed: Error: Compiler process exited with error Compilation failed
Problem in dependency elm-community/parser-combinators 2.0.0

So as of now keeping,

        "elm-community/elm-time": "1.0.8 <= v < 1.0.10",

If you interested, my dependencies in elm-package.json below

    "dependencies": {
        "Bogdanp/elm-querystring": "1.0.0 <= v < 2.0.0",
        "NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 4.0.0",
        "elm-community/elm-time": "1.0.8 <= v < 1.0.10",
        "elm-lang/core": "5.1.1 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "elm-lang/http": "1.0.0 <= v < 2.0.0",
        "elm-lang/keyboard": "1.0.1 <= v < 2.0.0",
        "elm-lang/mouse": "1.0.1 <= v < 2.0.0",
        "elm-lang/navigation": "2.1.0 <= v < 3.0.0",
        "evancz/url-parser": "2.0.1 <= v < 3.0.0",
        "krisajenkins/remotedata": "4.3.3 <= v < 5.0.0"
    },

Not sure if this is related, but elm-querystring, which depends on elm-combine, conflicts with remotedata: they both define an infix map (<$>) . Note the author of elm-querystring has archived the repo on github. Can you use url-parser for querystring parsing?

@playpauseandstop @ericgj thanks for your updates.

@ericgj

Thanks for your suggestion to get rid of Bogdanp/elm-querystring. After removing it from dependencies I finally be able to update to,

        "elm-community/elm-time": "1.0.14 <= v < 2.0.0",

Looks like the issue could be closed as of now, but going forward it would be neat to have better understanding of conflicting packages from elm-make output 🤔

ps. I needed elm-querystring for serializing Query Strings, not parsing.

going forward it would be neat to have better understanding of conflicting packages from elm-make output

Yeah, especially since the package mentioned in the error message seems to have nothing to do with the cause of the error. elm-community/parser-combinators is a maintained version of BogdanP/elm-combine , so maybe there's some kind of redirect going on when the packages are installed. In any case it's a quite unfriendly error. Maybe worth posting to the error message catalog ? What do you think @zwilias ?

I needed elm-querystring for serializing Query Strings, not parsing.

There's a little function for doing that here you might be able to use: https://github.com/elm-lang/http/issues/10

I'm about to release a major revision of elm-time that has completely removed parser-combinator in favor of Evan's elm-tools\parser in order to eliminate the former's custom infix operator problem altogether. All functionality is working and all tests (well over 600 of them are passing).

If you would like to see the changes, they are available at https://github.com/oldfartdeveloper/elm-time/tree/refactor. Please don't hesitate to ping me with questions and/or suggestions.

Released on #73 the promised major revision of elm-time; parser-combinators is no longer imported. This should solve most if not all of the infix operator collisions