Closed bremner closed 9 years ago
Is this also the case if you try and load it from the command line?
Hmm. So maybe it's not reasonable to expect elm-mode to load the file, but a better error message would be good:
> import Hello
The module name is messed up for ././Hello.elm
According to the file's name it should be Hello
According to the source code it should be Main
Which is it?
Should be fixed. Let us know if there are any issues.
@jcollard I'm using version 0.20.3 of elm-mode and I'm encountering the same issue. Perhaps there was a regression? I've cloned the elm-architecture-tutorial, opened up a random file in the examples folder, attempted to load the file in a repl and got the error "Module declaration not found".
I went ahead and declared a module at the top of the file:
module Main
-- The rest of 02-fields.elm...
And I got this error:
---- elm-repl 0.18.0 -----------------------------------------------------------
:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> :reset
Environment Reset
> import Main exposing (..)
I cannot find module 'Main'.
Module 'Repl' 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 also tried renaming the file to Main.elm
to match the name of the module but still no luck. I even tried
module Main exposing (..)
as mentioned in https://guide.elm-lang.org/reuse/modules.html, but still no luck getting the REPL to import my file for an interactive session.
I got the same error then trying to play with elm-architecture-tutorial
Got the same when trying to load the repl standing in the first example from the introduction guide on elm-lang.org (https://guide.elm-lang.org/)
in some simple examples, e.g.
http://elm-lang.org/examples/hello-html
there is no module declaration, which makes elm--get-module-name fail