Elm 'Hello World' program not running when using elm-reactor

589 views Asked by At

I just started using Elm. When I ran my hello world example(link to screenshot of code used given below) using elm-reactor, there is blank page on browser. There is also an error message on console describing it as a reference error (link to the screenshot given below). But, when using elm-make to create a html file from the code, it runs successfully.

Link to tutorial site referred to write the hello world example.

Please help me in finding the solution to the problem. If you need further information, just leave a comment.

Elm code used:

module Hello exposing (..)

import Html exposing ( text, Html )

main : Html a
main = text "Hello"

Error message on browser console:

ReferenceError: runElmProgram is not defined.

Browser output is blank screen.

2

There are 2 answers

0
Higsn On BEST ANSWER

Thank you all for your suggestions. Maybe, it was due to the way I installed Elm (build from source). Solved it by installing elm again from scratch using npm.

2
gyzerok On

In Elm module names and file names should start from a capital letter. Just rename your module to Hello and your file to Hello.elm.