Open jknight12882 opened 7 years ago
@jknight12882 -- Can you give us a little more information and (if possible) a failing unit test case example?
Do you mean that something like:
try {
_addScript(script);
} catch (err) {
// We now have an `err` from the actual `_addScript()` call (?)
}
The use case occurs when we try to load Omniture analytics tracking. The error is:
Which refers to the (Uglified) _addScript
function
Can you paste the stack trace / error message? I'm curious as to why it looks like t.parentNode
doesn't have an insertBefore(n, t)
or why that failed...
And reading what you've pasted, it looks like the GET
fails for /vendor/s_code.min.js
which theoretically should be handled by the error handlers by little-loader
(assuming you're using the err
object in the callback).
Alternately, if the omniture stuff isn't closed source, you could maybe create a jsbin or something repro-ing your issue so we can dive in with more info?
It's only handled if asynchronous. This is a synchronous error being thrown when trying to insert the dom. I'm using ublock
which is looking at the name of the js being inserted and comparing it against a blacklist of known names, and then rejecting.
Gotcha. Can you give me a full stack trace so I can see where I should be try/catch
-ing? It looks around the insertBefore
call?
Best I can do at this exact moment as we're inlining and wrapping the library to allow for parallel loading of multiple scripts
Thanks for the info.
... in the
_addScript
function, namely when the<script />
node is inserted into the DOM. These should be caught and returned in the callback