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.

Problem installing an external script and referencing a variable from it globally (MathJax)

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Output from: ng --version: @angular/cli: 1.0.0 node: 7.2.1 os: win32 x64 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/material: 2.0.0-beta.2 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.1

OS: Windows 10.

Repro steps.

I previously set yarn as my default package manager.

I started the project with ng new math-bug

I installed dependencies

yarn add express body-parser mathjax mongoose
yarn add @types\mathjax --dev

I modified the file .angular-cli.json adding the following to the scripts array (previously empty).

"../node_modules/mathjax/MathJax.js"

I added a component to my project that uses the line: “MathJax.Hub.Queue([ “Typeset”, MathJax.Hub, this.id]);”

The log given by the failure.

When I build my project I get the error: ERROR in C:/Users/Pat/ProgrammingProjects/math-bug/src/app/latex/latex.component.ts (23,9): Cannot find name ‘MathJax’. C:/Users/Pat/ProgrammingProjects/math-bug/src/app/latex/latex.component.ts (23,40): Cannot find name ‘MathJax’.

ERROR in C:/Users/Pat/ProgrammingProjects/math-bug/src/app/latex/latex.component.ts (23,9): Cannot find name ‘MathJax’. C:/Users/Pat/ProgrammingProjects/math-bug/src/app/latex/latex.component.ts (23,40): Cannot find name ‘MathJax’.

Desired functionality.

I would like to be able to use MathJax on my project. I previously had an Angular 2 project that used systemjs where this was not a problem. I believe I followed all the instructions for global library installation as described here, but it’s possible I’m misunderstanding something.

Mention any other details that might be useful.

I built a repo that demonstrated what’s happening. It can be seen here

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
isaacplmanncommented, Apr 3, 2017

Try adding "mathjax" to the types array in src/tsconfig.app.json. I had a similar error and that fixed it for me.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading and Configuring MathJax
If you install MathJax on a server in a domain that is different from the one containing the page that will load MathJax,...
Read more >
v2.4-latest PDF - MathJax Documentation
MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers.
Read more >
Making a Custom Build of MathJax
Create a javascript file to house the component and call it custom-mathjax. js . The file should contain the following code (we assume...
Read more >
Configuring and Loading MathJax
This will configure the TeX input component to use single dollar signs as in-line math delimiters, and the SVG output component to use...
Read more >
PDF - MathJax Documentation
MathJax is an open-source JavaScript display engine for LaTeX and ... formulas using TeX and LaTeX notation, or MathML, a World Wide Web ......
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