The error is simple... Before es5, there were no classes and using "new" was just syntactic sugar and you could, instead, just call the function. After, you can define a class using the "class" keyword (like in other languages) and you can no longer treat it like a function.
So, the error indicates the code is trying to treat the class as an invokable function which is not allowed. Just find where the class is being involved as a function and you have your fix. On Sun, Sep 9, 2018, 05:46 Christophe HOARAU <hoara...@gmail.com> wrote: > Hello everyone, > I have a project I started with angular2 beta, I've updated it > progressively to angular6 and webpack 4 and it's working but I'm still > using some old options. > The current compiler target is es5 so I would like to upgrade to es2017 or > at least es2015. But when I change the target in my tsconfig, the > compilation still works, I have the following error in the browser : > > Uncaught Error: Class constructor SysceaElementDefault cannot be invoked > without 'new': Error during instantiation of ScStorageRootService!. > caused by: Class constructor SysceaElementDefault cannot be invoked > without 'new' > at wrappedError (commons~main~vendor.chunk.js:56082) > at injectionError (commons~main~vendor.chunk.js:56116) > at instantiationError (commons~main~vendor.chunk.js:56201) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_._instantiate (commons~main~vendor.chunk. > js:56858) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_._instantiateProvider (commons~main~ > vendor.chunk.js:56836) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_._new (commons~main~vendor.chunk.js:56824 > ) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_._getObjByKeyId (commons~main~vendor. > chunk.js:56880) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_._getByKeyDefault (commons~main~vendor. > chunk.js:56912) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_._getByKey (commons~main~vendor.chunk.js: > 56873) > at ReflectiveInjector_.push.../../../../node_modules/@angular/core/ > fesm5/core.js.ReflectiveInjector_.get (commons~main~vendor.chunk.js:56796) > at scBootstrap (main.chunk.js:19432) > at Module../src/main.browser.ts (main.chunk.js:38645) > at __webpack_require__ (runtime.bundle.js:79) > at checkDeferredModules (runtime.bundle.js:46) > at Array.webpackJsonpCallback [as push] (runtime.bundle.js:33) > at main.chunk.js:2 > > > I've tried several things with no success till now. Does any one have an > idea of what to do ? > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to angular+unsubscr...@googlegroups.com. > To post to this group, send email to angular@googlegroups.com. > Visit this group at https://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Lucas Lacroix Computer Scientist Advanced Technology Division, MEDITECH <http://ehr.meditech.com/> 781-774-2293 -- <https://ehr.meditech.com/expanse> <https://www.linkedin.com/company/meditech> <https://twitter.com/MEDITECH> <https://www.facebook.com/MeditechEHR> Subscribe <https://info.meditech.com/get-great-meditech-content?hsCtaTracking=864299ec-5abf-4004-9c6d-2d051794101f%7Cc911be42-538a-4a48-8dca-a6d4001c6326> to receive emails from MEDITECH or to change email preferences. -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.