TypeError: span.toJSON is not a function
See original GitHub issueThis issue gets thrown if a span is being modified (annotation is added) after span has already been finished. Reason is the span will both have endTimestamp
and would be removed from partialSpans
in batch-recorder.js
. This would trigger following sequence of calls (in packages/zipkin/src/batch-recorder.js
):
if (span.endTimestamp) {
this._writeSpan(id);
Source: https://github.com/openzipkin/zipkin-js/blob/master/packages/zipkin/src/batch-recorder.js#L48-L49
and then
_writeSpan(id) {
const span = this.partialSpans.get(id); // this.partialSpans.get(id) will return undefined
Source: https://github.com/openzipkin/zipkin-js/blob/master/packages/zipkin/src/batch-recorder.js#L41-L42
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
getting this error " $.toJSON is not a function " - Stack Overflow
I'm trying to use jQuery and Ajax and I use this method. but I get the error $.toJSON is not a function in...
Read more >ERROR TypeError: "item.toJSON is not a function · Issue #2862
I came across this issue multiple times and the solution was to make sure that your "item" is an instance of "ProductListModel" in...
Read more >What is the `toJSON()` Function in JavaScript?
In JavaScript, the JSON.stringify() function looks for functions named toJSON in the object being serialized. If an object has a toJSON ...
Read more >enzyme-to-json.toJson JavaScript and Node.js code examples
describe('Dynamic Error component', () => { it('Does not render without show prop passed', () => { const wrapper = shallow(<DynamicError message="An Error ...
Read more >Uncaught TypeError: jQuery.getJSON is not a function : Forums
Uncaught TypeError: jQuery.getJSON is not a function. I am trying to use AJAX with Flask. I have the full version of the jQuery...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think easiest way is to put in a unit test for data added after span finished. then make sure it doesn’t raise error. not raising error is most important thing
This might not happen anymore as we now check if the retrieved span is undefined: https://github.com/openzipkin/zipkin-js/blob/aff41209df70502fe8ab09f60a6a0b4a7e4236bd/packages/zipkin/src/batch-recorder.js#L114