nativescript-floatingactionbutton icon indicating copy to clipboard operation
nativescript-floatingactionbutton copied to clipboard

Crash in flexbox-layout.android.js - Right-hand side of 'instanceof' is not an object

Open svmashok opened this issue 5 years ago • 5 comments

Hi @NathanWalker @NathanaelA @rigor789 @gabrielbiga @sitefinitysteve

I am using @nstudio/nativescript-floatingactionbutton version 2.1.0 in angular project and FAB button works fine. But i got error when i do logout from my application. Its just navigate to login page.. no special code inside.

Error: System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onCreateView failed System.err: TypeError: Right-hand side of 'instanceof' is not an object System.err: System.err: StackTrace: System.err: (file: apps\oxseco\src\webpack:\d:..\node_modules@nativescript\core\ui\layouts\flexbox-layout\flexbox-layout.js:14:0) System.err: at applyAllNativeSetters(file: apps\xxxxx\src\webpack:\d:....\node_modules@nativescript\core\ui\core\properties\properties.js:1065:0)

is there any nativescript core dependency is missing in the plugin?

html: <FAB (tap)="fabTap()" text="" rippleColor="#f1f1f1" class="fas fab-button" ></FAB>

ts: registerElement( 'Fab', () => require('@nstudio/nativescript-floatingactionbutton').Fab );

Note: Without FAB implementation in html it works fine. so it must be an error from the plugin only.

my application package json have "@angular/core": "9.1.0", "@angular/forms": "9.1.0", "@angular/platform-browser": "9.1.0", "@angular/platform-browser-dynamic": "9.1.0", "@angular/router": "9.1.0", "@nativescript/angular": "~9.0.0", "@nativescript/core": "~6.5.5",

Can anyone guide me

svmashok avatar Aug 05 '20 06:08 svmashok

https://github.com/NativeScript/NativeScript/issues/8739#issuecomment-669141477

rigor789 avatar Aug 05 '20 18:08 rigor789

Thanks for the fix @rigor789 .

When i try to build with @nativescript/[email protected], I got Module not found error from other dependencies

ERROR in d:/Project Workspace/node_modules/@nativescript/angular/http-client/http-utils.js Module not found: Error: Can't resolve '@nativescript/core/file-system/file-system' in 'd:\Project Workspace\node_modules@nativescript\angular\http-client' @ d:/Project Workspace/node_modules/@nativescript/angular/http-client/http-utils.js 3:20-73 @ d:/Project Workspace/node_modules/@nativescript/angular/http-client/ns-http-backend.js @ ./app/app.module.tns.ngfactory.js @ ./main.tns.ts

ERROR in d:/Project Workspace/node_modules/@nativescript/angular/element-registry.js Module not found: Error: Can't resolve '@nativescript/core/ui/border' in 'd:\Project Workspace\node_modules@nativescript\angular' @ d:/Project Workspace/node_modules/@nativescript/angular/element-registry.js 141:47-86 @ d:/Project Workspace/node_modules/@nativescript/angular/view-util.js @ d:/Project Workspace/node_modules/@nativescript/angular/router/page-router-outlet.js @ d:/Project Workspace/node_modules/@nativescript/angular/router/router.module.js @ ./app/app.module.tns.ngfactory.js @ ./main.tns.ts

ERROR in d:/Project Workspace/node_modules/nativescript-carousel/carousel.common.js Module not found: Error: Can't resolve 'tns-core-modules/color/color' in 'd:\Project Workspace\node_modules\nativescript-carousel' @ d:/Project Workspace/node_modules/nativescript-carousel/carousel.common.js 3:14-53 @ d:/Project Workspace/node_modules/nativescript-carousel/carousel.js @ d:/Project Workspace/libs/workbasket/feature-workbasket/src/lib/components/card/card.component.ts @ d:/Project Workspace/libs/workbasket/feature-workbasket/src/lib/components/wbmenu/wbmenu.component.ngfactory.js @ ./app/app.module.tns.ngfactory.js @ ./main.tns.ts

ERROR in d:/Project Workspace/node_modules/nativescript-carousel/carousel.common.js Module not found: Error: Can't resolve 'tns-core-modules/data/observable-array/observable-array' in 'd:\Project Workspace\node_modules\nativescript-carousel' @ d:/Project Workspace/node_modules/nativescript-carousel/carousel.common.js 4:25-91 @ d:/Project Workspace/node_modules/nativescript-carousel/carousel.js @ d:/Project Workspace/libs/workbasket/feature-workbasket/src/lib/components/card/card.component.ts @ d:/Project Workspace/libs/workbasket/feature-workbasket/src/lib/components/wbmenu/wbmenu.component.ngfactory.js @ ./app/app.module.tns.ngfactory.js @ ./main.tns.ts

ERROR in d:/Project Workspace/node_modules/nativescript-carousel/carousel.common.js Module not found: Error: Can't resolve 'tns-core-modules/ui/core/weak-event-listener/weak-event-listener' in 'd:\Project Workspace\node_modules\nativescript-carousel' @ d:/Project Workspace/node_modules/nativescript-carousel/carousel.common.js 6:28-103 @ d:/Project Workspace/node_modules/nativescript-carousel/carousel.js @ d:/Project Workspace/libs/workbasket/feature-workbasket/src/lib/components/card/card.component.ts @ d:/Project Workspace/libs/workbasket/feature-workbasket/src/lib/components/wbmenu/wbmenu.component.ngfactory.js @ ./app/app.module.tns.ngfactory.js @ ./main.tns.ts

ERROR in d:/Project Workspace/node_modules/nativescript-drop-down/drop-down.js Module not found: Error: Can't resolve 'ui/editable-text-base/editable-text-base' in 'd:\Project Workspace\node_modules\nativescript-drop-down' @ d:/Project Workspace/node_modules/nativescript-drop-down/drop-down.js 6:27-78 @ d:/Project Workspace/libs/shared/auth/feature-auth/src/lib/components/forgot-password/forgot-password.component.ts @ d:/Project Workspace/libs/shared/auth/feature-auth/src/lib/components/forgot-password/forgot-password.component.ngfactory.js @ ./app/app.module.tns.ngfactory.js @ ./main.tns.ts Executing webpack failed with exit code 2.

is there any other dependencies i need to update it in my package.json? Please guide me

Note: With nativescript-core version 6.5.12, there is no error other than the mentioned issue in #124

svmashok avatar Aug 06 '20 12:08 svmashok

@svmashok that is expected - we have been refactoring and cleaning up core for 7.0. Your imports need to be updated to always import from @nativescript/core and not nested paths like @nativescript/core/file-system/file-system. In your case, looks like it's not coming from your code - you would need to update to latest Angular to resolve the issues.

https://nativescript.org/blog/upgrading-tips-for-angular-10/

rigor789 avatar Aug 06 '20 12:08 rigor789

The "Error: Can't resolve '@nativescript/core/ui/border' " also appears when trying to create a project from the vue-cli template of NativeScript. Does this mean I have to change to the old version of nativescript until these issues are resolved? Before the upgrade to 7.0 everything was working fine.

loewl avatar Sep 03 '20 11:09 loewl

@loewl Are you using the ns7 branch of the template? It will be merged into master as soon as I get a chance - but currently you have to create the project with vue init nativescript-vue/vue-cli-template#ns7 myApp - however please note that component <style> blocks are not working with the latest version - I'm working on a fix, should be back to working in the next day or so.

rigor789 avatar Sep 03 '20 11:09 rigor789