Comments (12)
SCRIPT5009: 'Symbol' is undefined
from mathjax-src.
I went a bit further. Since it's not really in the same direction, I've renamed the issue.
Regarding Symbol, this seems expected behavior:
Please note that this requires a native Symbol.iterator or Symbol.iterator shim at runtime for any non-array values.
https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#new---downleveliteration
Adding the babel polyfill gets me Symbol (obviously) so using the babel loader with es2015 in webpack would workaround this. (IIUC Symbol.iterator cannot be shimmed correctly in generality.)
Next I run into the following:
HTMLNodes.prototype.node = function (type, def, children) {
if (def === void 0) { def = {}; }
if (children === void 0) { children = []; }
var node = this.document.createElement(type);
// ERROR Unable to get property 'createElement' of undefined or null reference
this.setProperties(node, def);
try {
for (var children_1 = __values(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
var child = children_1_1.value;
node.appendChild(child);
}
}
and if I hack those to the global document
, I run into an error with documentStyleSheet
(at which point I gave up).
from mathjax-src.
The issue with document
may be because of how your initial test.js
file references the DOM document. The contents of the test file seem to be put into a function with "use strict";
in the final webpacked version, which I believe may restrict the use of global variables. Try changing
const html = MathJax.document(document, {
to
const html = MathJax.document(window.document, {
instead. Or import DOM
from utils/DOM.js
and use
const html = MathJax.document(DOM.document, {
See if one of those does the trick.
from mathjax-src.
Thanks, Davide. I'll test it.
from mathjax-src.
I screwed up earlier and accidentally tested the TeX input (which has a whole other set of problems).
For the MathML input, the polyfill gets things up an running.
However, I get Math Processing error on all three elements - data-mjx-error="Can't call method on undefined"
.
So that's a step forward, I suppose.
from mathjax-src.
Let's continue F2F later.
from mathjax-src.
As requested during the last meeting, here's a hopefully sufficient demo for the IE11 math processing error problem.
Quick guide to re-build:
- put the files in a folder
- add/link to a copy of mathjax-v3 in a
./v3
subfolder (or changemmlpage.js
to point to the right place)- I used the
stretchy-cells
branch
- I used the
$ npm install wepback babel-loader babel-core babel-preset-env
$ npx webpack
- Open the HTML file in the E11+Win7 VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
- see Math Processing Errors
Note: the HTML page also loads the babel polyfill from cdnjs; this can probably be done more efficiently and/or at build time.
from mathjax-src.
Thanks, I'll take a look at it this weekend.
from mathjax-src.
OK, it turns out that the issue is that, in IE11, the MathML elements don't have the classList
property that HTML elements do (and the MathML elements do in other browsers), and so the places that MathJax uses Array.from(node.classList)
in the MathML input jax fail for IE11. For IE11, one has to use node.getAttributes('class').split(/ /)
to get the array, and when I change to that, the example works as expected. I'll look to see if there is any place else that this would affect things.
The output worked fine in IE11 and IE10 emulation, but two of the three equations caused output errors for IE9. I'll have to look into that further.
from mathjax-src.
in IE11, the MathML elements don't have the classList property that HTML elements do
holy cow, that's terrible. (FYI same for SVG elements, https://caniuse.com/#search=classlist)
Any chance we could somehow polyfill this on IE11 (we'd need a polyfill for IE9 as well).
from mathjax-src.
Any chance we could somehow polyfill this on IE11 (we'd need a polyfill for IE9 as well).
The classList
is only used in a couple of places, so I think we can certainly add a method that uses classList
when it is available, and the other approach when it isn't. So yes, we can work it out without too much trouble.
from mathjax-src.
https://github.com/eligrey/classList.js might be worth looking at (as it detects partial implementations).
from mathjax-src.
Related Issues (20)
- Collapsed font heights HOT 3
- How is a character's height/depth retrieved? HOT 6
- "ReferenceError: window is not defined" when dev page reloaded. HOT 1
- Multiple Typescript Errors HOT 9
- delete arguments.callee HOT 2
- support for \oiint and \oiiint HOT 1
- v4: DefaultFont.js not CJS HOT 2
- how do i customize the the latex defined by myself, and change it to mathml defined by myself HOT 1
- Overlapping output when using serveral expressions on the same page HOT 3
- SVG StyleList unused styles? HOT 3
- Reverse process HOT 1
- Integrate better tooling infra into mathjax
- ES6 class keyword used in "ES5" code due to bundled speech-rule-engine dependency HOT 6
- use mathjax3 in andriod5 show error "getExplicit of null" HOT 1
- Build directions don't work for v4-update branch HOT 3
- MathJax-Fonts repository private HOT 9
- Can I use a custom font in version 3.2?
- ts/util/asyncLoad/node.js needs ESM version HOT 9
- Can we migrated to MathJax.v3.2 version from V2 HOT 1
- installation of v4 not working with yarn HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathjax-src.