question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: span.toJSON is not a function

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
codefromthecryptcommented, Nov 24, 2018

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

0reactions
jcchavezscommented, Oct 16, 2019
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found