I once reported this in IRC channel but IIRC someone had convinced me that this is not a bug. Maybe that person can write the explanation here. (I don't remember who)
osa1, I am not that person, but here is an explanation. If you have a file called ./Foo.hs and you try to import it, ghci tells you that it doesn't know about that file, because you haven't loaded it yet:
$ ghciGHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for helpPrelude> import Foo<no location info>: Could not find module ‘Foo’ It is not a module in the current program, or in any known package.
The solution is to run :load Foo.hs before import Foo.
If you have a file called ./Data/List.hs, this now conflicts with the Data.List from base, so you get a different message clarifying which module is not loaded:
$ ghciGHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for helpPrelude> import Data.List<interactive>:1:1: attempting to use module ‘Data.List’ (./Data/List.hs) which is not loaded
The solution is to run :load Data/List.hs before import Data.List.
Now without -XNoImplicitPrelude, ghci begins by running import Prelude, which normally succeeds by loading the Prelude from base, but in this case, since there is a ./Prelude.hs file, ghci tells you that it can't use that file because it isn't loaded yet.
Since the user didn't explicitly type import Prelude, the error message is confusing, so maybe there should be some special logic to give a different message in that case or even to implicitly :load ./Prelude.hs. Note, however, that there are other modules than Prelude which can trigger this error message when particular files are present and the user hasn't explicitly typed an import statement. If your .ghci has an import Data.List intended to import the Data.List from base, it will usually work, until you have a local file called ./Data/List.hs in which case ghci will complain on startup with this same message that it can't use ./Data/List.hs because it is not loaded.
and there's no viable workaround to get bare stack repl to work; except by -XNoImplicitPrelude, renaming to something like LocalPrelude and explicit imports of it in every module.