Higsn
Higsn

Reputation: 197

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

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.

Upvotes: -1

Views: 598

Answers (2)

Higsn
Higsn

Reputation: 197

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.

Upvotes: 1

gyzerok
gyzerok

Reputation: 1418

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.

Upvotes: 0

Related Questions