mathlive icon indicating copy to clipboard operation
mathlive copied to clipboard

Math Live import issue

Open abhishekTropogo opened this issue 5 years ago • 9 comments

Description

Not Able to import and use in angular version 8 project

import * as mathlive from 'mathlive'; import 'mathlive'; import { mathlive } from 'mathlive'; all three imports gave error and index.html CDN also isn't working

image

Steps to Reproduce

[Provide steps that are specific and repeatable, if possible]

  1. [First Step] Import mathlive library in app.module.ts
  2. [Second Step] declare it in imports

Actual Behavior

Multiple Errors are being thrown

Expected Behavior

Expected that will render properly and work [What did you expect to happen insteead]

[Is this a regression: did it use to work in a previous version?] It used to work with version 0.59.0

Environment

MathLive version Current version: 0.69.0

Operating System [macOS, Windows, iOS. Include the version if possible] Windows Browser [Safari, Chrome, IE, Firefox, etc...] Chrome Browser

abhishekTropogo avatar Aug 03 '21 15:08 abhishekTropogo

image (1)

abhishekTropogo avatar Aug 03 '21 15:08 abhishekTropogo

It looks like there's a configuration issue in your project.

Can you share a reproducible test case?

arnog avatar Aug 03 '21 16:08 arnog

Hi @arnog , My package.json file :

{ "name": "AIRecruiter", "version": "1.0.0", "releaseVersion": "Beta v1.0", "scripts": { "ng": "ng", "start": "ng serve --progress", "build": "ng build --prod", "build-prod": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular-material-components/datetime-picker": "~2.0.4", "@angular/animations": "~8.0.2", "@angular/cdk": "~8.0.1", "@angular/common": "~8.0.2", "@angular/compiler": "~8.0.2", "@angular/core": "~8.0.2", "@angular/flex-layout": "7.0.0-beta.19", "@angular/forms": "~8.0.2", "@angular/http": "~7.2.15", "@angular/material": "~8.0.1", "@angular/platform-browser": "~8.0.2", "@angular/platform-browser-dynamic": "~8.0.2", "@angular/router": "~8.0.2", "@auth0/angular-jwt": "~3.0.0", "@fortawesome/angular-fontawesome": "~0.5.0", "@fortawesome/fontawesome-svg-core": "~1.2.25", "@fortawesome/free-solid-svg-icons": "~5.11.2", "@ngrx/effects": "~5.2.0", "@ngrx/entity": "~10.0.1", "@ngrx/store": "~8.6.0", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "@types/chart.js": "~2.8.5", "angular-google-recaptcha": "~1.0.3", "caniuse-lite": "~1.0.30001113", "chart.js": "~2.7.3", "chartjs-plugin-datalabels": "~0.7.0", "core-js": "~2.5.4", "crypto": "~1.0.1", "datetime-picker": "~0.6.0", "font-awesome": "~4.7.0", "fuse.js": "~3.4.5", "hammerjs": "~2.0.8", "html2canvas": "~1.0.0-rc.5", "jspdf": "^2.3.1", "mat-video": "~2.7.2", "mathjax-editor": "~1.1.6", "mathlive": "~0.35.1", "mathml2latex": "^1.0.0", "mixin-deep": "~2.0.1", "moment": "^2.29.1", "ng2-charts": "2.3.0", "ng2-file-upload": "~1.3.0", "ng2-fuse": "~0.1.0", "ngx-cookie-service": "^12.0.0", "ngx-file-drop": "~8.0.8", "ngx-infinite-scroll": "~9.0.0", "ngx-material-file-input": "~2.0.0", "ngx-mathjax": "0.0.13", "ngx-monaco-editor": "~8.1.1", "ngx-order-pipe": "~2.1.1", "ngx-quill": "~7.3.1", "quill": "~1.3.7", "rxjs": "~6.5.2", "stream": "0.0.2", "tslib": "~1.9.0", "web-animations-js": "2.3.2", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.803.19", "@angular/cli": "~8.3.20", "@angular/compiler-cli": "~8.0.2", "@angular/language-service": "~8.0.2", "@types/hammerjs": "~2.0.36", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "@types/jquery": "~3.5.5", "@types/moment": "^2.13.0", "@types/moment-timezone": "^0.5.30", "@types/node": "~8.9.4", "animate.css": "~4.1.1", "bcryptjs": "~2.4.3", "chartjs-plugin-gradient": "~0.1.0", "codelyzer": "~5.1.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.0.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "~0.2.2", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~3.4.5" }, "browser": { "crypto": false } }

abhishekTropogo avatar Aug 07 '21 15:08 abhishekTropogo

It's very difficult to debug this with the information provided, but I noticed in the screenshot you included (having an actual error log would be much better) that you appear to include the mathlive.css and mathlive.core.css files. Those files have been removed in Mathlive 0.53 (May 2020). See https://github.com/arnog/mathlive/blob/master/CHANGELOG.md

So, there's something wrong with your configuration, but without access to the project, I'm not going to be able to debug it for you.

arnog avatar Aug 11 '21 13:08 arnog

Can we connect with you on a zoom call whenever you are available & free?

abhishekTropogo avatar Aug 12 '21 03:08 abhishekTropogo

Did you seolve the isssue? i'm having a similar issue

don-spaghetti avatar Oct 18 '21 11:10 don-spaghetti

Did you seolve the isssue? i'm having a similar issue

Could you whip up a small test project where that error occurs? Then it would be possible for a maintainer to actually check it out, reproduce it and figure out what's causing that.

stefnotch avatar Oct 18 '21 19:10 stefnotch

There's another issue about this, so I'll copy my comment from there - It's because of the different version of Typescript used in the different projects. You can either upgrade your Angular (and Typescript) version or to add it to the project by adding a line like this to your index.html file -

evyatarbh avatar Nov 15 '21 15:11 evyatarbh

No activity in a long time. The dist/mathlive.min.js library is now transpiled for older toolchain, so hopefully this address this issue.

arnog avatar Apr 14 '22 00:04 arnog