Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Can't build Elm solution #55

Closed
omnibs opened this issue Dec 27, 2015 · 2 comments
Closed

Can't build Elm solution #55

omnibs opened this issue Dec 27, 2015 · 2 comments

Comments

@omnibs
Copy link

omnibs commented Dec 27, 2015

I tried building @mattjbray's elm solution and got this:

I cannot find find module 'Http'.

Module 'Main' is trying to import it.

I then ran elm-package install evancz/elm-http which added evancz/elm-http 3.0.0 to the elm-package.json file.

Running elm-make again gave me Cannot find variable Http.getWithAbort..

I searched the elm-http repo, all tags, for this method, nothing showed up on the sources. I thought maybe I hadded the wrong package and googled "http.getwithabort", only this repo showed up.

Maybe I'm doing something stupid, this is like the third example elm app I try to build. I'm going to the countryside with no internet and I thought I'd get some elm stuff building to be able to study them.

@mattjbray
Copy link
Contributor

Yes, getWithAbort is a custom function that you won't find anywhere else.

The spec for flux-challenge requires us to abort some XHRs, which the official elm-http package does not currently support.

The work-around is to use my fork of elm-http, where I've hacked in a getWithAbort function.

Quick Fix

Do the following to reset any changes in your local directory:

rm -rf submissions/mattjbray/elm-stuff
git checkout -- submissions/mattjbray/elm-package.json

Then follow steps 2-4 of the Elm submission README.

More detail

If you follow those steps you'll end up with my forked elm-http library in submissions/mattjbray/elm-http. elm-make will know where to look for the Http module because I've added this directory to elm-package.json: https://github.com/staltz/flux-challenge/blob/master/submissions/mattjbray/elm-package.json#L8

Here's the function signature for getWithAbort, if you're trying to follow the code: https://github.com/mattjbray/elm-http/blob/f6a5bf8ce10f9869ec45b275b4bfe3ad8b668475/src/Http.elm#L388

If you run into anything else that doesn't make sense, just ping me!

@omnibs
Copy link
Author

omnibs commented Jan 2, 2016

Works perfectly =]

@omnibs omnibs closed this as completed Jan 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants