Closed aaahrens closed 5 years ago
I've been getting this when there is an untyped alias or function at the top of a file. Feel free to close.
Hi, can you give me sample code? Thanks!
module Main exposing (Model, Msg(..), aThing, init, main, update, view)
import Browser
import Html exposing (Html, div, h1, img, text)
import Html.Attributes exposing (src)
aThing =
{ aField = "" }
---- MODEL ----
type alias Model =
{}
init : ( Model, Cmd Msg )
init =
( {}, Cmd.none )
---- UPDATE ----
type Msg
= NoOp
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
( model, Cmd.none )
---- VIEW ----
view : Model -> Html Msg
view model =
div []
[ img [ src "/logo.svg" ] []
, h1 [] [ text "Your Elm App is working!" ]
]
---- PROGRAM ----
main : Program () Model Msg
main =
Browser.element
{ view = view
, init = \_ -> init
, update = update
, subscriptions = always Sub.none
}
ripped straight from create-elm-app
if it helps at all, sometimes when the error gets thrown it emits the DummyElm modules into the project
Hi @aaahrens, I could not reproduce the issue :(
Can you log the value of outString
here:
https://github.com/halohalospecial/atom-elmjutsu/blob/master/lib/elm-make-runner.js#L428
Thanks!
Atom: 1.33.0
Mac: Mojave Version 10.14.1 (18875)
elmjutsu 9.9.1
Just doing a simple main = text "Hello world!" gives the following stack trace on save
Uncaught TypeError: Cannot read property 'split' of undefined
/Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:439
TypeError: Cannot read property 'split' of undefined at /Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:439:31 at Array.map (<anonymous>) at /Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:437:65 at ChildProcess.<anonymous> (/Users/johnmullany/.atom/packages/elmjutsu/lib/eval-helper.js:49:7) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
Hi @johnmullany,
Can you log the value of outString
and errString
here?
https://github.com/halohalospecial/atom-elmjutsu/blob/master/lib/elm-make-runner.js#L428
Thanks!
Also, are you using Elm 0.18 or 0.19?
0.19 and sure.
Not sure how to get the outString and errString...sorry.
@johnmullany
/Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js
.console.log('errString', errString);
console.log('outString', outString);
I'm not getting any console errors but I do get the same error but now on line 441.
Step by step, I put main = "Hello world!". The module Main exposing (main) is then added for me. It shows the red underline on main which I can hover over and get the error description. I also get the same error in the diagnostics panel. When I add just the text function with the "Hello World!" string I get a new error description. Once I add the import Html exposing (..) I get the uncaught type error about the cannot read property 'split' of undefined. If I close the error at that point, I still have the same error notification that I cannot find a 'text' variable even though it is syntactically correct. Sorry I can't be of more help.
where do we catch stdout of the console log? @johnmullany me too >.> this package is why I'm using atom. How are you liking elm?
@aaahrens, it's in /Users/drunkengranite/.atom/packages/elmjutsu/lib/elm-make-runner.js
in your case.
Elm is great. I love it. I don't want to hijack this thread but I am anxious to hear what @aaahrens gets back from the addition of the console logs.
So I didn't get anything from the errString or the outString as far as the log goes so I put another console log for result on line 441 of elm-make-runner.js and get undefined for result. Split then tries to read undefined.
/Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:407 result line 441 undefined /Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:408 Uncaught TypeError: Cannot read property 'split' of undefined at /Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:442:31 at Array.map (<anonymous>) at /Users/johnmullany/.atom/packages/elmjutsu/lib/elm-make-runner.js:439:65 at ChildProcess.<anonymous> (/Users/johnmullany/.atom/packages/elmjutsu/lib/eval-helper.js:49:7) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Socket.stream.socket.on (internal/child_process.js:346:11) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at Pipe._handle.close [as _onclose] (net.js:554:12)
By the way, Elmjutsu is awesome. I used it before I went to Visual Studio Code and returned to Atom only because of Elmjutsu.
@aaahrens @johnmullany can you try v9.9.2? Thanks!
On line 437 I tried
const issues = _.zip(namesAndRanges, typeAnnotations);
and then mapping issues
issues.map(([{name, range}, result]) => { console.log('result', result); });
I get result is undefined. I'm not sure if this helps but if there is anything else I can try please let me know and I should be more prompt about a response.
Perfect!! v9.9.2 is working. Thanks!!!
[Enter steps to reproduce:]
Atom: 1.32.2 x64 Electron: 2.0.9 OS: Mac OS X 10.14.1 Thrown From: elmjutsu package 9.9.1
Stack Trace
Uncaught TypeError: Cannot read property 'split' of undefined
Commands
Non-Core Packages