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

can't find variable require #71

Closed
arifsuheyl opened this issue May 23, 2022 · 9 comments · Fixed by #80
Closed

can't find variable require #71

arifsuheyl opened this issue May 23, 2022 · 9 comments · Fixed by #80

Comments

@arifsuheyl
Copy link

While importing MathText and Mathview, im getting the error in the picture. There is no error in install. How can I fix this?

Ekran Resmi 2022-05-24 00 36 27

@ShaMan123
Copy link
Owner

I don't know.
Try using resolutions field in package.json for react-native.

@kabonKoda
Copy link

Just fix this here too .... in your node modules go to mathjax-full/components/version.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = (typeof PACKAGE_VERSION === 'undefined' ?
(function () {
return require('../../package.json').version;
})() :
PACKAGE_VERSION);
//# sourceMappingURL=version.js.map

paste this there

@arifsuheyl
Copy link
Author

Thanks. It worked!

@ShaMan123
Copy link
Owner

@kabonKoda what does it fix? What is broken?

@arifsuheyl
Copy link
Author

@kabonKoda what does it fix? What is broken?

there was a problem In node_modules/mathjax-full/components/version.js file.

var load = eval('require');
var dirname = eval('__dirname');
var path = load('path');
return load(path.resolve(dirname, '..', '..', 'package.json')).version;
In this code eval('require') gives an error about require and linking package.json manually worked.

@pkra
Copy link

pkra commented May 24, 2022

If this is related to v3.2.1, then mathjax/MathJax-src#818 is probably worth a read.

@ShaMan123
Copy link
Owner

ShaMan123 commented May 24, 2022

@pkra thanks for the intel.
You guys can do as suggested in that link until this is resolved.
You can use some patching mechanism like yarn patch instead.
I'd appreciate checking in or PRing if someone has a valid solution

@ShaMan123
Copy link
Owner

I have pushed a commit, hopefully is fixes this issue until mathjax fixes it upstream.
My android studio is not letting me load the emulator.
I'd appreciate if you guys could clone the repo and test locally that everything works.
I'll release a version once the fix is confirmed.

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

Successfully merging a pull request may close this issue.

4 participants