So i am using the Avaya SDK (basically 3 JS files) in my Angular project. When i try to import it i get an error saying that it is not a module? Any idea how to fix that?
my import statement:
import * as AvayaClientServices from '../../../assets/lib/AvayaClientServices.min.js';
declare const AvayaClientServices: any
There is btw no "export" in the JS File so i dont know if thats the issue? The whole file has li 30k Lines of Code so here is the beginning:
! function(T) {
var S = jQuery;
! function(e) {
"use strict";
function i(e) {
this.clientConfiguration = e, this.user = T, this.mediaServicesFactory = T, this.version = "4.8.0.37", i.Base.Logger.clearLoggers()
}
i.prototype = {
createUser: function(e) {
return this.user || (this.mediaServicesFactory === T && (this.mediaServicesFactory = new i.Base.MediaServicesFactory), i.SDK_VERSION = this.version, this.user = new i.User(e, this.mediaServicesFactory, this.version)), this.user
},
registerLogger: function(e, t) {
i.Base.Logger.addLogger(e, t)
},
getMediaServices: function() {
return this.mediaServicesFactory === T && (this.mediaServicesFactory = new i.Base.MediaServicesFactory), this.mediaServicesFactory.getMediaServices()
},
getVersion: function() {
return this.version
}
}, e.AvayaClientServices = i
Modulesare a mechanism thatJavaScriptruntimesupports to allow the split of huge chunks of code into small reusable pieces that you can use (import) in other programs.The above error is due to missing
exportkeyword fromsource-file. Theruntimefailed to identify what you are pointing to during the interpretation of the reference statement.As stated in
MDNright here