Sometime between when `id: 39` and `id: 40` is created during `rawSpawn` 
the `root` key in the object goes null.  Still trying to find what code is 
wiping it...


On Wednesday, August 3, 2016 at 12:21:18 PM UTC-6, OvermindDL1 wrote:
>
> The task object with `id: 39` does not have a null `root` at the time it 
> is put into workQueue.  At the time it is put into the workQueue it is: 
>  {callback : function(b), ctor: "_Task_andThen", task: {callback: 
> function(callback), cancel: function(), ctor: "_Task_nativeBinding"}}
>
> The root.task.callback function seems to have one interesting closure that 
> has a key/value of `navStart:1470247637381`, and there is another link in 
> the cancel to the process with `id: 38` so it appears to be a 
> continuation of that one.  I am not sure of the internal structure of Elm 
> so I am not sure what Native Binding it is called, and I use no Native 
> Bindings in my project (only what comes with Elm core libraries is what 
> exists here at all).
>
> A little further digging and I am seeing 
> `_elm_lang$animation_frame$Native_AnimationFrame` in the stack, further 
> digging makes it seem (although I am unsure) that the `root.task.callback` 
> is the same function as defined at:  
> https://github.com/elm-lang/animation-frame/blob/master/src/Native/AnimationFrame.js#L13
>
> I am not yet seeing how the `root` key on this "_Process" object is 
> getting cleared yet before it has a chance to be processed, still tracing...
>
>
> On Wednesday, August 3, 2016 at 11:59:23 AM UTC-6, OvermindDL1 wrote:
>>
>> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to