Closed jeyben closed 4 years ago
According to stackoverflow, it seems to be an issue with IE not supporting object property rest: https://stackoverflow.com/questions/53628191/edge-script1028-expected-identifier-string-or-number
To have IE and Edge support for svgjs, the syntax of the function needs to be rewritten
My angular app was importing the module and after compilation i was having same error. I replaced the import with declaring a global declare const SVG:any and imported the compiled script into my angular.json . Now its working. I got it from this answer
With the new transpiled bundle for esm this should work in all supported browsers now
It works! Thanks!
Bug report
My angular application is using svgjs (se versions below): "@angular/animations": "8.0.0", "@angular/common": "8.0.0", "@angular/compiler": "8.0.0", "@angular/core": "8.0.0", "@angular/forms": "8.0.0", "@angular/platform-browser": "8.0.0", "@angular/platform-browser-dynamic": "8.0.0", "@angular/router": "8.0.0", "@svgdotjs/svg.js": "^3.0.13" ... When running my application in an IE Edge browser I get the following error: "SCRIPT1028: Expected identifier, string or number"
And it refers to: Runner.js:765
let target = new Matrix({ ...transforms, origin: [ x, y ] })
The reason is that the code uses object property rest, which isn´t supported by IE or Edge, hence the library and the application using it, won´t run in IE and Edge browsers :-(