Hi Juan, I hope someone else more knowledgeable than me chimes in, but
here's a possibly interesting clue: when I copy the `matchers` function
into a `let...in` block for `parsePath`, the issue seems to go away:

```
parsePath : Maybe String -> Maybe Route
parsePath pathname =
    let
        matchers : Parser (Route -> a) a
        matchers =
            oneOf
                [ map TopRoute top
                , map LoginRoute ((s "login") <?> (urlParam "redirect"))
                ]
    in
        case pathname of
            Just path ->
                parse matchers path Dict.empty

            Nothing ->
                Nothing
```

On Wed, Mar 15, 2017 at 8:54 AM, Juan Ibiapina <juanibiap...@gmail.com>
wrote:

> I'm still struggling. Does anyone know of anything that can cause this?
> Compiler issues? Maybe something relative to my project setup...
>
> On Tue, Mar 14, 2017 at 3:40 PM, Juan Ibiapina <juanibiap...@gmail.com>
> wrote:
>
>> Because the original error is related to the order of the functions in
>> the generated code. It doesn't get past that so it doesn't actually call
>> `document`.
>>
>> On Tue, Mar 14, 2017 at 1:57 PM, Duane Johnson <duane.john...@gmail.com>
>> wrote:
>>
>>> Yes, it was on the repl. I was able to replicate your original error
>>> there, though, which is odd if there is this additional repl-specific
>>> constraint.
>>>
>>> On Mar 14, 2017 5:39 AM, "Juan Ibiapina" <juanibiap...@gmail.com> wrote:
>>>
>>>> Duane, are you trying it on the repl? In that case `document` probably
>>>> isn't available, and this error probably comes from elm-navigation.
>>>>
>>>> From what I gather, ktonon's url-parser only removes the dependency on
>>>> elm-navigation `Location`, which is something I require to parse a path
>>>> string.
>>>>
>>>> On Tue, Mar 14, 2017 at 12:59 AM, Duane Johnson <
>>>> duane.john...@gmail.com> wrote:
>>>>
>>>>> Not sure if this is helpful, but if I redefine `urlParam` as follows:
>>>>>
>>>>> ```
>>>>> urlParam : String -> QueryParser (Maybe Route -> a) a
>>>>> urlParam name =
>>>>>     customParam name (\_ -> Nothing)
>>>>> ```
>>>>>
>>>>> I get a new error:
>>>>>
>>>>> ```
>>>>> /Users/duane/tmp/elm-typeerror/repl-temp-000.js:8831
>>>>> var location = document.location;
>>>>>                       ^
>>>>>
>>>>> ReferenceError: document is not defined
>>>>>     at Object.getLocation (/Users/duane/tmp/elm-typeerro
>>>>> r/repl-temp-000.js:8831:25)
>>>>>     at Function.func (/Users/duane/tmp/elm-typeerro
>>>>> r/repl-temp-000.js:9035:43)
>>>>>     at A2 (/Users/duane/tmp/elm-typeerror/repl-temp-000.js:92:11)
>>>>>     at Object.<anonymous> (/Users/duane/tmp/elm-typeerro
>>>>> r/repl-temp-000.js:9504:31)
>>>>>     at Object.<anonymous> (/Users/duane/tmp/elm-typeerro
>>>>> r/repl-temp-000.js:9545:4)
>>>>>     at Module._compile (module.js:570:32)
>>>>>     at Object.Module._extensions..js (module.js:579:10)
>>>>>     at Module.load (module.js:487:32)
>>>>>     at tryModuleLoad (module.js:446:12)
>>>>>     at Function.Module._load (module.js:438:3)
>>>>> ```
>>>>>
>>>>> Could there be some kind of incompatibility introduced by `ktonon`s
>>>>> version of `url-parser` when the `elm-lang/html` package is imported? (the
>>>>> docs on ktonon's elm package page say his/her variant of
>>>>> `evancz/url-parser` is for server-side use only).
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Elm Discuss" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to elm-discuss+unsubscr...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Juan
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Elm Discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to elm-discuss+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Elm Discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to elm-discuss+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Juan
>>
>
>
>
> --
> Juan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to