Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'makeMathField' of undefined #39

Open
shundaime opened this issue Aug 27, 2021 · 14 comments
Open

TypeError: Cannot read property 'makeMathField' of undefined #39

shundaime opened this issue Aug 27, 2021 · 14 comments

Comments

@shundaime
Copy link

I was trying to use your package the simple way as i could with this part of code to start :

render() {
  return <MathfieldComponent
    initialLatex="f(x)=\\log _10 x"
    onChange={this.onMathChange}
  />;
}

onMathChange(mathText) {
  console.log(mathText);
}

But i get this :
Capture d’écran du 2021-08-27 09-57-13

I don't understand why, can you help please ?

@joaortizro
Copy link

Hello this is due to some webpack configurations, see arnog/mathlive#1123

@shundaime
Copy link
Author

Hello we are not using webpack, this is react standalone

@arnog
Copy link

arnog commented Sep 2, 2021

This is not specifically a problem with webpack. In the case of the react toolchain, there is an intermediary tool (whose name I forget) that doesn't know how to parse optional chaining. Anyhoo... The latest version of Mathlive has reverted to not using optional chaining to accommodate those toolchains.

@shundaime
Copy link
Author

Hello, what is for you the latest version of Mathlive ?
Here is our : "react-mathlive": "^3.0.5-preview.1",

@reinvanimschoot
Copy link

@arnog We tried updating to the latest version of react-mathlive and mathlive but we still get the same error. Are we missing something? Cheers!

@arnog
Copy link

arnog commented Sep 27, 2021

Which version of MathLive are you using?

@reinvanimschoot
Copy link

@arnog 0.59.0

@arnog
Copy link

arnog commented Sep 28, 2021

That's the problem. The current version is 0.69.7.

@reinvanimschoot
Copy link

I upgraded to 0.69.7 but I still get this error

Cannot read property 'makeMathField' of undefined

@reinvanimschoot
Copy link

Is it possible that react-mathlive is not compatible with the latest version of mathlive?

@dobesv
Copy link

dobesv commented Oct 15, 2021

I have the same issue. Any idea which version of mathlive can be used with react-mathlive?

$ grep mathlive package.json
    "mathlive": "^0.69.7",
    "react-mathlive": "^3.0.5-preview.1",

@dobesv
Copy link

dobesv commented Oct 22, 2021

I wonder if this is a duplicate of #34

@yurnery
Copy link

yurnery commented Dec 3, 2021

any solutions?

@dobesv
Copy link

dobesv commented Dec 3, 2021

Just have you make your own mathlive react component, it's not that hard to do TBH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants