L. Blommers
L. Blommers

Reputation: 93

Yesod scaffolded devel: "Failed to load interface for 'Application'"

I'am trying to run a scaffolded Yesod site with MySQL (on Ubuntu 16.04). But when I try to run it with devel the following error occurs:

app/devel.hs:2:1: error:
Failed to load interface for ‘Application’
It is not a module in the current program, or in any known package.
Unexpected: child process exited with ExitFailure 1

I have tried it using (from inside the project folder):

stack exec -- yesod devel
yesod devel

Both producing the error.

It does work running the app normaly

stack install
stack exec my-project

Upvotes: 1

Views: 171

Answers (2)

Christian Di Lorenzo
Christian Di Lorenzo

Reputation: 3612

I had this exact error and tried deleting the project and regenerating it to no luck. However, once I upgraded stack it worked perfectly:

$ stack upgrade
Current Stack version: 1.3.2, available download version: 1.4.0
Newer version detected, downloading
...

$ stack exec -- yesod devel
...
ExitSuccess
Type help for available commands. Press enter to force a rebuild.
Starting devel application
Devel application launched: http://localhost:3000

Upvotes: 3

L. Blommers
L. Blommers

Reputation: 93

lucas@lucas-ms-7673:~/Data/Projecten/basicwebsite$ stack clean
lucas@lucas-ms-7673:~/Data/Projecten/basicwebsite$ yesod devel
Yesod devel server. Enter 'quit' or hit Ctrl-C to quit.
Application can be accessed at:

http://localhost:3000
https://localhost:3443
If you wish to test https capabilities, you should set the following variable:
export APPROOT=https://localhost:3443

basicwebsite-0.0.0: unregistering (local file changes: Application.hs
Foundation.hs Handler/Comment.hs Handler/Common.hs Handler/Home.hs
Handler/Profile...)
basicwebsite-0.0.0: configure (lib)
Configuring basicwebsite-0.0.0...
basicwebsite-0.0.0: build (lib)
Preprocessing library basicwebsite-0.0.0...
[ 1 of 11] Compiling Settings         ( Settings.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Settings.o )
[ 2 of 11] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs,.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Settings/StaticFiles.o )
[ 3 of 11] Compiling Model            ( Model.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Model.o )
[ 4 of 11] Compiling Import.NoFoundation ( Import/NoFoundation.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Import/NoFoundation.o )
[ 5 of 11] Compiling Foundation       ( Foundation.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Foundation.o )
[ 6 of 11] Compiling Import           ( Import.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Import.o )
[ 7 of 11] Compiling Handler.Comment  ( Handler/Comment.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Comment.o )
[ 8 of 11] Compiling Handler.Common   ( Handler/Common.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Common.o )
[ 9 of 11] Compiling Handler.Home     ( Handler/Home.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Home.o )
[10 of 11] Compiling Handler.Profile  ( Handler/Profile.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Profile.o )
[11 of 11] Compiling Application      ( Application.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Application.o )
basicwebsite-0.0.0: copy/register
Installing library in
/home/lucas/Data/Projecten/basicwebsite/.stack-work/install/x86_64-linux/lts-8.5/8.0.2/lib/x86_64-linux-ghc-8.0.2/basicwebsite-0.0.0-TYYyVjSz8i3CoGALY18CQ
Registering basicwebsite-0.0.0...
ExitSuccess
Type help for available commands. Press enter to force a rebuild.

app/devel.hs:2:1: error:
Failed to load interface for ‘Application’
It is not a module in the current program, or in any known package.
Unexpected: child process exited with ExitFailure 1
Trying again

lucas@lucas-ms-7673:~/Data/Projecten/basicwebsite$ stack exec ghc-pkg list basicwebsite
/home/lucas/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
(no packages)
/home/lucas/.stack/snapshots/x86_64-linux/lts-8.5/8.0.2/pkgdb
(no packages)
/home/lucas/Data/Bedrijf/Projecten/basicwebsite/.stack-work/install/x86_64-linux/lts-8.5/8.0.2/pkgdb
basicwebsite-0.0.0 

Upvotes: -1

Related Questions