Import modules unresolved
See original GitHub issueProblem
A local module is marked as unused (not installed via elm). The function call is marked as unresolved reference.
What have I tried this far?
- elm.json is connected and loads correctly (altho the module is not mentioned in this file since its not installed via elm install)
- external libraries are shown
- elm-stuff is included in intellij
- cache has been invalidated
Reproduce
Url.elm
module Url exposing (getUrl)
getUrl : String
getUrl =
"http://localhost:8080/"
NewType.elm referencing Url.elm
module NewType exposing (init, main)
import Browser
import Game exposing (Msg)
import Html exposing (Html, div, text)
import Url exposing (getUrl) -- marked as not used
main =
Browser.element
{ init = init
, update = update
, subscriptions = always Sub.none
, view = view
}
type alias Model =
Int
init : () -> ( Model, Cmd Msg )
init _ =
( 1, Cmd.none )
useImport : String
useImport =
getUrl -- marked as unresolved
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
view : Model -> Html Msg
view model =
div [] [ text "something" ]
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
local module import not working - unresolved reference
Cant figure out why my local modeule/ file import suddenly isnt working anymore. Here is an example where it is clearly visible that...
Read more >Unresolved reference in multi-project window to a module ...
Unresolved references in imports of modules appear if: A module is located inside a directory present in sys.path of the project interpreter; And, ......
Read more >Unresolved import of local python file if main script is not at ...
When importing your own python modules which are in the workspace folder, but the main script is not in the root directory of...
Read more >Unresolved reference for import, even though the module ...
If that doesnt work it could be inconpatible or maybe wrong syntax. What module is it and qhat Python version. Woupd be helpful...
Read more >Python unresolved import: How to Solve Pylint Error
For the Python-specific imports, it resolves the unresolved import issue, but it won't resolve your own modules. When importing your own ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We do try to handle shadowing correctly, but I never thought about this case. The problem is that there are 2
Url
modules visible: one defined in your project and the other which is an indirect dependency. I assumed that you could never have 2 modules with the same name in the same project, but I forgot about the indirect dependency case. I’ll see what I can do to fix it.In the meantime, you can workaround the issue by giving your Url module a different name.
This should be fixed by #614. If the issue still exists in the latest version of the plugin (3.5.1), please open a new issue.