Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upUncaught TypeError if Json.Decode is not imported (module loading order problem?) #686
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Aug 9, 2016
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Aug 9, 2016
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
RobertWalter83
changed the title from
Module loading order problem?
to
Uncaught TypeError if Json.Decode is not imported (module loading order problem?)
Aug 9, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Aug 10, 2016
Member
It appears that the presence of a port module alone doesn't inform the compiler of the need to import Json.Decode. Here's a succinct SSCCE for which you can examine the generated code and note the absence of Json.Decode
port module Main exposing (..)
port example : (String -> msg) -> Sub msg
value =
1|
It appears that the presence of a port module alone doesn't inform the compiler of the need to import port module Main exposing (..)
port example : (String -> msg) -> Sub msg
value =
1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Aug 29, 2016
Member
@lukewestby, feel free to close issues and open nicer ones if you figure things out like this! I did this with #703.
|
@lukewestby, feel free to close issues and open nicer ones if you figure things out like this! I did this with #703. |
evancz
closed this
Aug 29, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lzrski
Nov 29, 2017
Also running into this issue with React Native talking to Elm program via ports. The error is
Can't find variable _elm_lang$core$Json_Decode$string
Adding import Json.Decode solves the problem. See relevant code here.
lzrski
commented
Nov 29, 2017
|
Also running into this issue with React Native talking to Elm program via ports. The error is
Adding |
RobertWalter83 commentedAug 9, 2016
•
edited
Edited 1 time
-
RobertWalter83
edited Aug 9, 2016 (most recent)
I experience an issue which might be related to #683.
I created a SSCCE to illustrate the problem.
Im working on Windows 10. I use Elm 0.17.1, core 4.0.3.
Description:

I have a port module where I have defined all my app's ports. If this module does not import "Json.Decode", I get an Uncaught TypeError exception:
I am aware of this discussion. I do not use elm-webpack-loader.