The error is:
```
Uncaught TypeError: _user$project$Main$urlParam is not a function
at Object.eval (Main.elm:13428)
at eval (Main.elm:13854)
at Object.<anonymous> (bundle.js:1381)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (index.js:2)
at Object.<anonymous> (bundle.js:1336)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (multi_main:3)1
```
And here's a snippet of the generated JS:
```
var _user$project$Main$matchers = _ktonon$url_parser$UrlParser$oneOf(
{
ctor: '::',
_0: A2(_ktonon$url_parser$UrlParser$map, _user$project$Main$TopRoute,
_ktonon$url_parser$UrlParser$top),
_1: {
ctor: '::',
_0: A2(
_ktonon$url_parser$UrlParser$map,
_user$project$Main$LoginRoute,
A2(
_ktonon$url_parser$UrlParser_ops['<?>'],
_ktonon$url_parser$UrlParser$s('login'),
_user$project$Main$urlParam('redirect'))), <------------------ ERROR
_1: {ctor: '[]'}
}
});
var _user$project$Main$urlParam = function (name) {
return A2(_ktonon$url_parser$UrlParser$customParam, name,
_user$project$Main$parsePath);
};
```
On Mon, Mar 13, 2017 at 10:54 PM, Juan Ibiapina <[email protected]>
wrote:
> Greetings everyone,
>
> I got a type error while trying to rewrite a login redirect in Elm. I
> extracted the basic functionality to this project: https://github.com/
> juanibiapina/elm-typeerror
>
> I've googled and searched the mailing lists but was unable to find
> something related.
>
> From what I understand so far by looking at the generated javascript, the
> `urlParam` function is always put after its usage. If I reorder the
> functions it doesn't seem to make a difference, although it does solve the
> issue in my original project.
>
> Does anyone know what is going on?
>
> Cheers,
> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.