small medium large xlarge

12 Jan 2018, 02:28
Osvaldo Kotaro Takai (1 post)

I compiled Picshare04.elm and reflash my browser, but it only displays the photo Surffing, the other two photos are not displayed. What could be happening?

12 Jan 2018, 12:20
Jeremy Fairbank (5 posts)

Hi, Osvaldo.

Sorry to hear you’re having trouble with one of the examples. Can you share which chapter you’re working on? A few chapters have a Picshare04.elm file.

03 Feb 2018, 13:05
Derek McLoughlin (1 post)


I’m also having issues in this. From the code in “code/get-started/static-app”.

Starting with:

elm make Picshare01.elm –output picshare.js

This worked.

Then re-compiling Picshare02.elm, Picshare03.elm, Picshare04.elm in that order, each works.

However, going back to any of the previous examples by recompiling doesn’t work.

You get:

> elm make Picshare03.elm --output picshare.js
Success! Compiled 0 modules.
Successfully generated picshare.js

The issue is that it’s not compiling anything!

Is there any way to force it to re-compile other than ‘touching’ the file?

Windows 10, Elm 0.18, Node 9.5.0


08 Feb 2018, 14:34
Jeremy Fairbank (5 posts)

Hi, Derek.

The message is misleading, but Elm is “compiling” the file still. Elm caches compiled code in the elm-stuff/build-artifacts directory. If the source file hasn’t changed, then Elm can use the cached code when generating the JavaScript file. If you change the file or touch it as you mentioned, then Elm will recompile the code, cache the compiled code, and generate a JavaScript file from the new cached code.

You can check that Elm still generates JavaScript by inspecting the file with ls -l picshare.js (or the Windows equivalent like dir picshare.js?) before compiling, waiting a minute, compiling, and inspecting again. The creation time should change for the file.

Hope that helps.

You must be logged in to comment