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.

Crash when serializing division with LaTeX

See original GitHub issue

Version: 0.4.4

Steps:

  1. Initialize Compute Engine
  2. Set jsonSerializationOptions.metadata = ['latex']
  3. Parse 1/x
  4. Try to print the MathJson for the resulting BoxedExpression.

Here’s a quick node session replicating the problem:

> const ComputeEngine = require("@cortex-js/compute-engine").ComputeEngine
undefined
> let myCe = new ComputeEngine()
undefined
> myCe.parse("1/x").json
[ 'Divide', 1, 'x' ]
> myCe.jsonSerializationOptions.metadata = ['latex']
[ 'latex' ]
> myCe.parse("1/x").json
Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'global'
    --- property 'global' closes the circle
    at JSON.stringify (<anonymous>)
    at /Users/bengold/brilliant/node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js:2:69692
    at Ne.serialize (/Users/bengold/brilliant/node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js:2:69710)
    at ke.serialize (/Users/bengold/brilliant/node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js:2:74791)
    at zt.serialize (/Users/bengold/brilliant/node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js:2:267194)
    at vi (/Users/bengold/brilliant/node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js:2:140335)
    at Oi.get json [as json] (/Users/bengold/brilliant/node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js:2:163316)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bengoldscommented, Apr 5, 2022

Thanks a million, Arno! Super excited to get these fixes (and some of the new features in compute engine) integrated 😄

1reaction
arnogcommented, Apr 5, 2022

I’ve published compute-engine@0.5.0 that incorporate these changes and a corresponding mathlive@0.5.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help writing a simple long division problem with LaTex - TeX
I started a new creative job and somehow got asked to write a LaTex code snippit that depicts the following division.
Read more >
Parsing and Serializing LaTeX - CortexJS
“The Divide function is represented as “ \frac{x}{y} ””. The Compute Engine includes a default LaTeX dictionary to parse a number of common...
Read more >
TensorBoard with Histograms crashes with Dropout Layers
The most recent version of Keras crashes after the first epoch when a TensorBoard callback is added that records histograms.
Read more >
Untitled
New zealand role models, Rugby league 4 nations tournament, 36 division, ... Hendrick nascar plane crash, Pemain widya jemari jiwaku menari, Kasi arunodayam ......
Read more >
Expected BEGIN_OBJECT but was STRING at line 1 column 1
Basically I needed to deserialize following nested JSON String into my ... you may need to do some try..catch.. for this strange response...
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