Debugged into it and caught the exception at the point to get the stack 
values:
```javascript
numSteps = 403
process = Object {ctor: "_Process", id: 39, root: null, stack: null, mailbox
: Array[0]}
```
So root is null, why would it be trying to access a null value without 
checking if null?

Any ideas how to work around this in this project so I can at least keep 
working in chrome?


On Wednesday, August 3, 2016 at 11:52:36 AM UTC-6, OvermindDL1 wrote:
>
> I keep getting this exception thrown from inside Elm, so far only from 
> Chrome Version 51.0.2704.103 m
> ```
> elm.js:2417  Uncaught TypeError: Cannot read property 'ctor' of null
> ```
>
> Where that line and the surrounding context is purely Elm generated code, 
> and is:
> ```javascript
> // STEP PROCESSES  // Line 2411
>
> function step(numSteps, process)
> {
> while (numSteps < MAX_STEPS)
> {
> var ctor = process.root.ctor;  // Line 2417 -- This is the error: 
>  Uncaught TypeError: Cannot read property 'ctor' of null
>
> if (ctor === '_Task_succeed')
> {
> while (process.stack && process.stack.ctor === '_Task_onError')
> {
> process.stack = process.stack.rest;
> }
> if (process.stack === null)
> ```
>
> The same javascript seems to run fine in firefox, IE, and edge, this only 
> seems to happen in Chrome and only 'sometimes'.  It seems to happen pretty 
> quickly during loading and if it does not happen at the start then it does 
> not seem to happen.  I've not been able to find code to whittle down that 
> lets my app still do anything while still causing this error.
>
> The 'step' function is being called from the 'work' function of (and with 
> context):
> ```
> javascript
>
> // WORK QUEUE
>
> var working = false;
> var workQueue = [];
>
> function enqueue(process) {
> workQueue.push(process);
>
> if (!working) {
> setTimeout(work, 0);
> working = true;
> }
> }
>
> function work() {
> var numSteps = 0;
> var process;
> while (numSteps < MAX_STEPS && (process = workQueue.shift())) {
> numSteps = step(numSteps, process); // This is the place in the callstack 
> before step
> }
> if (!process) {
> working = false;
> return;
> }
> setTimeout(work, 0);
> }
> ```
>
> Chrome is not reporting anything in the stack below `work` so this appears 
> to be during the setTimeout callback set a few lines prior to work that 
> calls work.
>
> Any thoughts as to the cause?
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to