I am trying to play around with Elm (0.17) a little bit. But I can't get this simple example running:
import Graphics.Element exposing (..)
main =
show "Hello!"
The following error is shown when running elm reactor
:
I cannot find module 'Graphics.Element'.
Module 'Main' is trying to import it.
Potential problems could be:
- Misspelled the module name
- Need to add a source directory or new dependency to elm-package.json
I did run elm package install evancz/elm-graphics
and it was successfully. I also see it when opening localhost:8000 under the Dependencies Sidebar.
When looking at other examples they doing the import the same way.
What could cause the problem?
In version 0.17, The module name has changed to Element
and you'll need to convert Graphics elements to Html now. Try changing your code to the following:
import Element exposing (..)
main =
toHtml <| show "Hello!"
According to the current elm-lang.org/examples hello-html is now written as
import Html exposing (text)
main =
text "Hello!"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With