Open mratanusarkar opened 4 months ago
I have Angular 18 and tried mathjax-angular
for the first time today. I got a similar message, which went away when I overrode the dependencies (in package.json
):
"overrides": {
"mathjax-angular": {
"@angular/common": "^18.0.2",
"@angular/core": "^18.0.2"
}
},
You could try overriding with your current Angular version...
@kussmaul thanks! it works with this override! I'm curious if this has any side effects, or may introduce issues in the future. and if this falls under angular best practices.
for anyone reading @kussmaul's suggestion, and confused on where to put the "overrides" in package.json
,
here is how your package.json
will look like: (eg: for Angular 15)
{
"name": "project-name",
"version": "0.0.0",
"scripts": {...},
"private": true,
"dependencies": {
...
"@angular/common": "^15.2.0",
"@angular/compiler": "^15.2.0",
"@angular/core": "^15.2.0",
...
"mathjax-angular": "^2.1.1",
...
"zone.js": "~0.12.0"
},
"devDependencies": {...},
"overrides": {
"mathjax-angular": {
"@angular/common": "^15.2.0",
"@angular/core": "^15.2.0"
}
}
}
[source]
@kussmaul thanks! it works with this override! I'm curious if this has any side effects, or may introduce issues in the future. and if this falls under angular best practices.
@mratanusarkar, I'm not an expert on this, but problems would arise if mathjax-angular
truly can't run with your overridden version (e.g., incompatible API calls). You should review the override when you update things and remove it when no longer needed.
You should review the override when you update things and remove it when no longer needed.
the place where I am using this library is based on Angular 15. as of now, your suggested change works fine! so, I will go with it. Thanks!
It's just updating the parent angular dependency version and no changes to the library itself. anyway, I will keep a watch if anything breaks.
following up with issue #27, after PR #30, the expectation was that
mathjax-angular 2.2.1
would be compatible with all angular versions 17 and below!but currently getting the following error with my Angular 15 project, and the issue still stays unresolved as mentioned in #27
error stack on
npm i mathjax-angular
: