Uptodate version of MVCTodo

I’m new to Elm. For first project I want to update versions of MVCTodo. I updated the elm-package.json and I replace Html.app for Html, but I get the error

-- NAMING ERROR ------------------------------------------------------- Todo.elm ModuleNavigationdoes not exposeParser22| import Navigation exposing (Parser) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

when I run elm-reactor. Anyone could help?

Hey there! I am pretty new as well but it looks like the Parser type was moved out of the Navigation module in the newer version.

Searching for that type in the docs here -> Navigation did not bring it up.

I think you may want to look into this package instead -> url-parser

1 Like

Thanks for answering. How to do this replacement? In Todo.elm Parser appears in many places:

In import:

import Navigation exposing (Parser)

Line 325:

main : Program Flags
main =
    Navigation.programWithFlags urlParser
        { urlUpdate = urlUpdate
        , view = view
        , init = init
        , update = update
        , subscriptions = subscriptions

and at line 356:

urlParser : Parser (Maybe String)
urlParser =
Navigation.makeParser (fromUrl << .hash)

how to transform these bits of code?


I don’t have a lot of experience in Elm, but I followed this video Elmseeds, Episode 53: SPA - Navigation, and refactored your code so it works:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.