This project is a PWA and works even w/o stylesheets (just the infos then) and w/o JS (no offline capabilities then).
Start a development server with e.g.:
$ npx live-server
Deployment on Now
$ ./deploy.sh
Monitor your elm program with redux-devtools
License: MIT License
I think it has to do with msg being the unit type.
type alias Model_ =
{ array : Array Int
}
type Msg_
= Blah
main : Program () Model_ Msg_
main =
Monitor.sandbox
{ init = { array = Array.fromList [ 5 ] }
, view = \_ -> Html.button [ Html.Events.onClick Blah ] [ Html.text "produces an error in console" ]
, update = \_ model -> model
}
This code works fine, but if I replace Msg_
with ()
then I get the n is null
exception.
Originally posted by @MartinSStewart in #9 (comment)
A model containing an escaped backslash will cause elm-monitors parsing to fail.
Here's a simple example
main : Program () String ()
main =
Monitor.sandbox
{ init = "\\"
, view = \_ -> Html.button [ Html.Events.onClick () ] [ Html.text "produces an error in console" ]
, update = \_ model -> model
}
This occurred in version 0.0.9
The following code will generate an error in the console when clicking the button. Note that the error is not generated if Vec3 is removed from the model.
module Main exposing (main)
import Math.Vector3 as Vec3
import Monitor
import Html exposing (Html)
import Html.Events
type Msg_
= Msg_
type alias Model_ =
{ v : Vec3.Vec3
}
main : Program () Model_ Msg_
main =
Monitor.sandbox
{ init =
{ v = Vec3.vec3 0 0 0
}
, view = \_ -> Html.button [ Html.Events.onClick Msg_ ] [ Html.text "produces an error in console" ]
, update = \_ model -> model
}
The following code prints the error Expecting Variable at row 1, col 25
in the console
type alias NewModel =
{ aField : SomeType
}
type SomeType
= WithChar Char
main : Program Flags NewModel MsgBase
main =
Monitor.element
{ init = \_ -> ({ aField = WithChar ' '}, Cmd.none)
, view = \_ -> Html.div [] []
, update = \_ model -> (model, Cmd.none)
, subscriptions = \_ -> Sub.none
}
The output elm-monitor output looks like this [Monitor:init]: { aField = WithChar (' ') }
.
Edit: I'm using version 0.0.11
After setting up elm-monitor I get the following exception in the console repeatedly
Expecting Keyword False at row 1, col 1
Expecting Symbol () at row 1, col 1
Expecting Symbol ' at row 1, col 1
Expecting Symbol " at row 1, col 1
Expecting Symbol < at row 1, col 1
Expecting { at row 1, col 1
Expecting [ at row 1, col 1
Expecting Keyword True at row 1, col 116
Expecting Keyword False at row 1, col 116
Expecting Symbol () at row 1, col 116
Expecting Symbol ' at row 1, col 116
Expecting Symbol " at row 1, col 116
Expecting Symbol < at row 1, col 116
Expecting { at row 1, col 116
Expecting [ at row 1, col 116
Expecting Symbol ( at row 1, col 116
Expecting Variable at row 1, col 116
Expecting Number at row 1, col 116
Expecting Variable at row 1, col 1
Expecting Number at row 1, col 1
I've used elm-monitor with another Elm project and I haven't seen the exception there. I'm not sure what the difference is that causes it to appear here. This exception appears both on Firefox and Chrome.
Edit: The frequency of these exceptions seems to match when a certain Elm msg is received. In case it helps, this is what elm-monitor writes out for that msg
(LongPollRequest (Err NetworkError),{ currentTime = Posix 1551788676113, hideErrorOverlay = False, lastMessageId = -1, messages = [], quietForOneSecond = Debouncer (Config { accumulator = <function>, emitWhenUnsettled = Nothing, emitWhileUnsettled = Nothing, settleWhenQuietFor = Just 1000 }) Settled, releaseBuilds = Loading, serverData = Failure NetworkError, uploadTimeRequest = Nothing })
If the model has a string field with the text \"
in it then
Expecting Keyword True at row 1, col 1
Expecting Keyword False at row 1, col 1
Expecting Symbol () at row 1, col 1
Expecting Symbol ' at row 1, col 1
Expecting Symbol " at row 1, col 1
Expecting Symbol < at row 1, col 1
Expecting { at row 1, col 1
Expecting [ at row 1, col 1
Expecting , at row 1, col 386
Expecting } at row 1, col 386
Expecting Variable at row 1, col 1
Expecting Symbol - at row 1, col 1
Expecting Number at row 1, col 1
gets printed to the console on every update.
Edit: So for example, type alias Model = { someText : String}
and initialModel = { someText = "\""}
Edit2: This occurred in version 0.0.8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.