urbanslug / wai-devel

A development server for wai applications.
MIT License
10 stars 6 forks source link

Slashes and Periods are Stripped out of File Locations? #25

Closed prikhi closed 8 years ago

prikhi commented 8 years ago

I'm getting this error when running wai-devel in my Spock project:

[~/Projects/git/om-prototypes/spock] $ wai-devel -p src/Main.hs
Starting devel application at http://localhost:3000
UpdateStatusRequiredRestart
UpdateStatusDone
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcUtilshs
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcTypeshs
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcModels/Basehs
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcImporths
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcHandlers/Productshs
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcHandlers/Categorieshs
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcApphs
Error: <no location info> can't find file: /home/prikhi/Projects/git/om-prototypes/spock/srcMainhs

My app file is src/Main.hs, with a function named develMain.

urbanslug commented 8 years ago

@prikhi Give me a few hours I believe this had been fixed in a certain PR. I shall look into it.

prikhi commented 8 years ago

Sweet, thank you :)

prikhi commented 8 years ago

OK update time, I grabbed the wai-devel source and ran stack install and file resolution seems to work fine. Previously I had used stack to install wai-devel(stack install wai-devel). I don't know much about stack, but you might want to patch or bump the version that's available on there.

It's now able to find the file/function I specify via CLI flags, but it seems to be running my program twice, & throwing an error when it tries to serve the application on the port it's already using:

$ wai-devel -p src/Main.hs -f main 
Starting devel application at http://localhost:3000
UpdateStatusRequiredRestart
UpdateStatusProgress [1 of 8] Compiling Types
UpdateStatusProgress [2 of 8] Compiling Models.Base
UpdateStatusProgress [3 of 8] Compiling Utils
UpdateStatusProgress [4 of 8] Compiling Import
UpdateStatusProgress [5 of 8] Compiling Handlers.Categories
UpdateStatusProgress [6 of 8] Compiling Handlers.Products
UpdateStatusProgress [7 of 8] Compiling App
UpdateStatusProgress [8 of 8] Compiling Main
UpdateStatusDone
Spock is running on port 3000
Run result: RunProgException "IOException: bind: resource busy (Address already in use)"

Checking netstat -tulpn:

$ sudo netstat -tulpn | grep 3000 
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      10881/wai-devel  

Maybe my code in main is off? It lives here: https://github.com/Southern-Exposure-Seed-Exchange/Order-Manager-Prototypes/blob/master/spock/src/Main.hs

prikhi commented 8 years ago

Oops, I forgot about the reverse proxy. Disabling that fixes my previous issue. I didn't get how to tell wai-devel which port to proxy.

urbanslug commented 8 years ago

Yeah let me bump up the version on Stackage. There was some updated code there. Sorry, I just have no time.

urbanslug commented 8 years ago

Version bump though the code needs serious maintenance.

urbanslug commented 8 years ago

This was fixed, closing.