New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - ctor is not a constructor #318

Closed
Ericky14 opened this Issue Nov 9, 2017 · 8 comments

Comments

Projects
None yet
5 participants
@Ericky14

Ericky14 commented Nov 9, 2017

Hello,

I am running into an error when running my app. Does anyone know how to at least debug this to know where it is coming from? Is it a problem with router-outlets not being supported by webpack?

JS: ERROR TypeError: ctor is not a constructor
JS: ERROR CONTEXT [object Object]
JS: ERROR Error: Uncaught (in promise): TypeError: ctor is not a constructor
JS: TypeError: ctor is not a constructor
JS:     at _createClass (file:///data/data/com.ink.application/files/app/vendor.js:10001:20)
JS:     at _createProviderInstance$1 (file:///data/data/com.ink.application/files/app/vendor.js:9977:26)
JS:     at resolveNgModuleDep (file:///data/data/com.ink.application/files/app/vendor.js:9962:17)
JS:     at NgModuleRef_.module.exports.NgModuleRef_.get (file:///data/data/com.ink.application/files/app/vendor.js:11036:16)
JS:     at resolveDep (file:///data/data/com.ink.application/files/app/vendor.js:11524:45)
JS:     at createClass (file:///data/data/com.ink.application/files/app/vendor.js:11394:32)
JS:     at createDirectiveInstance (file:///data/data/com.ink.application/files/app/vendor.js:11225:37)
JS:     at createViewNodes (file:///data/data/com.ink.application/files/app/vendor.js:12666:53)
JS:     at createRootView (file:///data/data/com.ink.application/files/app/vendor.js:12556:5)
JS:     at callWithDebugContext (file:///data/data/com.ink.application/files/app/vendor.js:13941:42)
JS:     at Object.debugCreateRootView [as createRootView] (file:///data/data/com.ink.application/files/app/vendor.js:13245:12)
JS:     at ComponentFactory_.module.exports.ComponentFactory_.create (file:///data/data/com.ink.application/files/app/vendor.js:10335:46)
JS:     at ComponentFactoryBoundToModule.module.exports.ComponentFactoryBoundToModule.create (file:///data/data/com.ink.application/files/app/vendor.js:3807:29)
JS:     at ViewContainerRef_.module.exports.ViewContainerRef_.createComponent (file:///data/data/com.ink.application/files/app/vendor.js:10533:62)
JS:     at RouterOutlet.module.exports.RouterOutlet.activateWith (file:///data/data/com.ink.application/files/app/vendor.js:21024:40)

@Ericky14 Ericky14 changed the title from Error - ES6 Compiling to Error - ctor is not a constructor Nov 10, 2017

@Ericky14

This comment has been minimized.

Show comment
Hide comment
@Ericky14

Ericky14 Nov 10, 2017

Sorry about that, created with wrong title by accident.

Ericky14 commented Nov 10, 2017

Sorry about that, created with wrong title by accident.

@NickIliev NickIliev added the question label Nov 13, 2017

@NickIliev

This comment has been minimized.

Show comment
Hide comment
@NickIliev

NickIliev Nov 13, 2017

Member

Hey, @Ericky14 were you able to resolve your issue?
If you are still experiencing troubles please post sample project which can reproduce the issue so we could investigate on our side.
if the project is private you can contact me at the community slack - username: niki_iliev

Member

NickIliev commented Nov 13, 2017

Hey, @Ericky14 were you able to resolve your issue?
If you are still experiencing troubles please post sample project which can reproduce the issue so we could investigate on our side.
if the project is private you can contact me at the community slack - username: niki_iliev

@Ericky14

This comment has been minimized.

Show comment
Hide comment
@Ericky14

Ericky14 Nov 14, 2017

@NickIliev I am still having the same issue. And I am having a completely different issue when I setup a fresh project.

I believe the previous error I got has to do with <page-router-outlet>, but I can't even get this one to run when using NativeScriptCommonModule instead of NativeScriptModule.

System.err: Error: No provider for Compiler!
System.err: File: "file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js, line: 3577, column: 12
System.err: 
System.err: StackTrace: 
System.err: 	Frame: function:'ZoneAwareError', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 73742, column: 33
System.err: 	Frame: function:'injectionError', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 2097, column: 90
System.err: 	Frame: function:'noProviderError', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 2135, column: 12
System.err: 	Frame: function:'module.exports.ReflectiveInjector_._throwOrNull', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3577, column: 19
System.err: 	Frame: function:'module.exports.ReflectiveInjector_._getByKeyDefault', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3616, column: 25
System.err: 	Frame: function:'module.exports.ReflectiveInjector_._getByKey', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3548, column: 25
System.err: 	Frame: function:'module.exports.ReflectiveInjector_.get', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3417, column: 21
System.err: 	Frame: function:'resolveNgModuleDep', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10420, column: 25
System.err: 	Frame: function:'_createClass', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10459, column: 29
System.err: 	Frame: function:'_createProviderInstance$1', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10431, column: 26
System.err: 	Frame: function:'initNgModule', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10384, column: 28
System.err: 	Frame: function:'NgModuleRef_', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 11481, column: 9
System.err: 	Frame: function:'createNgModuleRef', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 11465, column: 12
System.err: 	Frame: function:'debugCreateNgModuleRef', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 13750, column: 12
System.err: 	Frame: function:'module.exports.NgModuleFactory_.create', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 14758, column: 25
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 5425, column: 61
System.err: 	Frame: function:'module.exports.ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 73114, column: 26
System.err: 	Frame: function:'onInvoke', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 4818, column: 33
System.err: 	Frame: function:'module.exports.ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 73113, column: 32
System.err: 	Frame: function:'module.exports.Zone.run', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 72874, column: 43
System.err: 	Frame: function:'module.exports.NgZone.run', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 4749, column: 69
System.err: 	Frame: function:'module.exports.PlatformRef_._bootstrapModuleFactoryWithZone', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 5423, column: 23
System.err: 	Frame: function:'module.exports.PlatformRef_.bootstrapModuleFactory', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 5405, column: 21
System.err: 	Frame: function:'_bootstrapper', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 65205, column: 66
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 65281, column: 21
System.err: 	Frame: function:'module.exports.Observable.notify', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 38270, column: 23
System.err: 	Frame: function:'module.exports.PageBase.onNavigatingTo', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 59856, column: 14
System.err: 	Frame: function:'module.exports.FrameBase._onNavigatingTo', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 51450, column: 37
System.err: 	Frame: function:'module.exports.FrameBase.performNavigation', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 51418, column: 14
System.err: 	Frame: function:'module.exports.FrameBase._processNavigationContext', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 51405, column: 18
System.err: 	Frame: function:'resume_1', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 17369, column: 68
System.err: 	Frame: function:'module.exports.Observable.notify', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 38270, column: 23
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 16271, column: 24
System.err: 
System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:912)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:896)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:888)
System.err: 	at com.tns.gen.android.app.Application_ActivityLifecycleCallbacks.onActivityResumed(Application_ActivityLifecycleCallbacks.java:24)
System.err: 	at android.app.Application.dispatchActivityResumed(Application.java:216)
System.err: 	at android.app.Activity.onResume(Activity.java:1251)
System.err: 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1269)
System.err: 	at android.app.Activity.performResume(Activity.java:6783)
System.err: 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3406)
System.err: 	... 10 more

The sample project I created is attached here.
WebpackTest.zip

Ericky14 commented Nov 14, 2017

@NickIliev I am still having the same issue. And I am having a completely different issue when I setup a fresh project.

I believe the previous error I got has to do with <page-router-outlet>, but I can't even get this one to run when using NativeScriptCommonModule instead of NativeScriptModule.

System.err: Error: No provider for Compiler!
System.err: File: "file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js, line: 3577, column: 12
System.err: 
System.err: StackTrace: 
System.err: 	Frame: function:'ZoneAwareError', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 73742, column: 33
System.err: 	Frame: function:'injectionError', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 2097, column: 90
System.err: 	Frame: function:'noProviderError', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 2135, column: 12
System.err: 	Frame: function:'module.exports.ReflectiveInjector_._throwOrNull', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3577, column: 19
System.err: 	Frame: function:'module.exports.ReflectiveInjector_._getByKeyDefault', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3616, column: 25
System.err: 	Frame: function:'module.exports.ReflectiveInjector_._getByKey', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3548, column: 25
System.err: 	Frame: function:'module.exports.ReflectiveInjector_.get', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 3417, column: 21
System.err: 	Frame: function:'resolveNgModuleDep', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10420, column: 25
System.err: 	Frame: function:'_createClass', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10459, column: 29
System.err: 	Frame: function:'_createProviderInstance$1', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10431, column: 26
System.err: 	Frame: function:'initNgModule', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 10384, column: 28
System.err: 	Frame: function:'NgModuleRef_', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 11481, column: 9
System.err: 	Frame: function:'createNgModuleRef', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 11465, column: 12
System.err: 	Frame: function:'debugCreateNgModuleRef', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 13750, column: 12
System.err: 	Frame: function:'module.exports.NgModuleFactory_.create', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 14758, column: 25
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 5425, column: 61
System.err: 	Frame: function:'module.exports.ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 73114, column: 26
System.err: 	Frame: function:'onInvoke', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 4818, column: 33
System.err: 	Frame: function:'module.exports.ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 73113, column: 32
System.err: 	Frame: function:'module.exports.Zone.run', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 72874, column: 43
System.err: 	Frame: function:'module.exports.NgZone.run', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 4749, column: 69
System.err: 	Frame: function:'module.exports.PlatformRef_._bootstrapModuleFactoryWithZone', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 5423, column: 23
System.err: 	Frame: function:'module.exports.PlatformRef_.bootstrapModuleFactory', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 5405, column: 21
System.err: 	Frame: function:'_bootstrapper', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 65205, column: 66
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 65281, column: 21
System.err: 	Frame: function:'module.exports.Observable.notify', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 38270, column: 23
System.err: 	Frame: function:'module.exports.PageBase.onNavigatingTo', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 59856, column: 14
System.err: 	Frame: function:'module.exports.FrameBase._onNavigatingTo', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 51450, column: 37
System.err: 	Frame: function:'module.exports.FrameBase.performNavigation', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 51418, column: 14
System.err: 	Frame: function:'module.exports.FrameBase._processNavigationContext', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 51405, column: 18
System.err: 	Frame: function:'resume_1', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 17369, column: 68
System.err: 	Frame: function:'module.exports.Observable.notify', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 38270, column: 23
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.WebpackTest/files/app/vendor.js', line: 16271, column: 24
System.err: 
System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:912)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:896)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:888)
System.err: 	at com.tns.gen.android.app.Application_ActivityLifecycleCallbacks.onActivityResumed(Application_ActivityLifecycleCallbacks.java:24)
System.err: 	at android.app.Application.dispatchActivityResumed(Application.java:216)
System.err: 	at android.app.Activity.onResume(Activity.java:1251)
System.err: 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1269)
System.err: 	at android.app.Activity.performResume(Activity.java:6783)
System.err: 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3406)
System.err: 	... 10 more

The sample project I created is attached here.
WebpackTest.zip

@Ericky14

This comment has been minimized.

Show comment
Hide comment
@Ericky14

Ericky14 Nov 14, 2017

I resolved the first issue with ctor is not a constructor. It had with do with the nativescript-barcodescanner plugin.

Initializing that plugin in the constructor argument list caused that error and simply doing this.barcodeScanner = new BarcodeScanner() works.

Not sure if I should close this issue or not since there are errors on that sample app I posted.

Ericky14 commented Nov 14, 2017

I resolved the first issue with ctor is not a constructor. It had with do with the nativescript-barcodescanner plugin.

Initializing that plugin in the constructor argument list caused that error and simply doing this.barcodeScanner = new BarcodeScanner() works.

Not sure if I should close this issue or not since there are errors on that sample app I posted.

@NickIliev NickIliev closed this Nov 15, 2017

@masrc

This comment has been minimized.

Show comment
Hide comment
@masrc

masrc Dec 21, 2017

Hey, I having the same Issue and I couldn't resolve this, I tried really hard, but no succsess

masrc commented Dec 21, 2017

Hey, I having the same Issue and I couldn't resolve this, I tried really hard, but no succsess

@Ericky14

This comment has been minimized.

Show comment
Hide comment
@Ericky14

Ericky14 Dec 22, 2017

It's most likely an issue with a third party plugin, I suggest trying to uninstall them or install them on an empty package one by one.

Ericky14 commented Dec 22, 2017

It's most likely an issue with a third party plugin, I suggest trying to uninstall them or install them on an empty package one by one.

@dhagej

This comment has been minimized.

Show comment
Hide comment
@dhagej

dhagej Apr 29, 2018

@Ericky14 this was exactly the same issue in my case, you comment really helped me to save time on our production release. Thank you

dhagej commented Apr 29, 2018

@Ericky14 this was exactly the same issue in my case, you comment really helped me to save time on our production release. Thank you

@stulli103

This comment has been minimized.

Show comment
Hide comment
@stulli103

stulli103 Sep 20, 2018

Hello hello, I am having similar problems as listed above and I am also using the barcode scanner. Can someone elaborate on how the problems listed above were fixed in a more specific manner.

This is the error I am getting

JS: ERROR Error: Uncaught (in promise): TypeError: t is not a constructor
JS: TypeError: t is not a constructor
JS: at Fo (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:82099)
JS: at Mo (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:81890)
JS: at Do (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:81764)
JS: at e.get (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:93086)
JS: at Da (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:97979)
JS: at Na (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:96755)
JS: at Oa (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:94925)
JS: at ys (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:110440)
JS: at ps (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:109144)
JS: at Pu (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:123894)

stulli103 commented Sep 20, 2018

Hello hello, I am having similar problems as listed above and I am also using the barcode scanner. Can someone elaborate on how the problems listed above were fixed in a more specific manner.

This is the error I am getting

JS: ERROR Error: Uncaught (in promise): TypeError: t is not a constructor
JS: TypeError: t is not a constructor
JS: at Fo (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:82099)
JS: at Mo (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:81890)
JS: at Do (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:81764)
JS: at e.get (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:93086)
JS: at Da (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:97979)
JS: at Na (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:96755)
JS: at Oa (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:94925)
JS: at ys (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:110440)
JS: at ps (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:109144)
JS: at Pu (file:///data/data/org.nativescript.LudusApp/files/app/vendor.js:1:123894)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment