akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.05k stars 1.51k forks source link

Nebular Auth in NativeScript #647

Closed RodrigoPauletti closed 6 years ago

RodrigoPauletti commented 6 years ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

Current behavior: I'm trying to use the Nebular Auth and Theme in my NativeScript project, but the project doesn't compile successfully.

Related code:

NativeScript Playground: https://play.nativescript.org/?template=play-ng&id=ivxKp2&v=2

Error log:

2018-08-17 11:54:29.261 nsplaydev[1527:448166] ***** Fatal JavaScript exception - application has been terminated. *****
2018-08-17 11:54:29.261 nsplaydev[1527:448166] Native stack trace:
1 0x10334373c NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)
2 0x103374068 -[TNSRuntime executeModule:referredBy:]
3 0x103200714 -[UIApplication(PlayLiveSync) swizzled_executeModule:]
4 0x102cd93dc
5 0x181581fc0 
2018-08-17 11:54:29.262 nsplaydev[1527:448166] JavaScript stack trace:
2018-08-17 11:54:29.262 nsplaydev[1527:448166] 1 require@file:///app/@nebular/auth/bundles/auth.umd.js:2:231
2 @file:///app/@nebular/auth/bundles/auth.umd.js:2:231
3 anonymous@file:///app/@nebular/auth/bundles/auth.umd.js:5:2
4 evaluate@[native code]
5 moduleEvaluation@[native code]
6 @[native code]
7 promiseReactionJob@[native code]
8 require@[native code]
9 anonymous@file:///app/app.module.js:7:23
10 evaluate@[native code]
11 moduleEvaluation@[native code]
12 @[native code]
13 promiseReactionJob@[native code]
14 require@[native code]
15 anonymous@file:///app/main.js:6:27
16 evaluate@[native code]
17 moduleEvaluation@[native code]
18 @[native code]
19 promiseReactionJob@[native code]
2018-08-17 11:54:29.262 nsplaydev[1527:448166] JavaScript error:
file:///app/@nebular/auth/bundles/auth.umd.js:2:231: JS ERROR Error: Could not find module '@nebular/theme'. Computed path '/var/mobile/Containers/Data/Application/FB0F9A66-FBB5-488F-AB77-16CF1CDA83EB/Documents/Playground/LiveSync/app/tns_modules/@nebular/theme'.
2018-08-17 11:54:29.263 nsplaydev[1527:448166] PlayLiveSync: Uncaught Exception
2018-08-17 11:54:29.263 nsplaydev[1527:448166] *** JavaScript call stack:
(

)
2018-08-17 11:54:29.263 nsplaydev[1527:448166] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not find module '@nebular/theme'. Computed path '/var/mobile/Containers/Data/Application/FB0F9A66-FBB5-488F-AB77-16CF1CDA83EB/Documents/Playground/LiveSync/app/tns_modules/@nebular/theme'.
at 
1 require@file:///app/@nebular/auth/bundles/auth.umd.js:2:231
2 @file:///app/@nebular/auth/bundles/auth.umd.js:2:231
3 anonymous@file:///app/@nebular/auth/bundles/auth.umd.js:5:2
4 evaluate@[native code]
5 moduleEvaluation@[native code]
6 @[native code]
7 promiseReactionJob@[native code]
8 require@[native code]
9 anonymous@file:///app/app.module.js:7:23
10 evaluate@[native code]
11 moduleEvaluation@[native code]
12 @[native code]
13 promiseReactionJob@[native code]
14 require@[native code]
15 anonymous@file:///app/main.js:6:27
16 evaluate@[native code]
17 moduleEvaluation@[native code]
18 @[native code]
19 promiseReactionJob@[native code]
', reason: '(null)'
*** First throw call stack:
(0x181c2ad8c 0x180de45ec 0x103343e60 0x103374068 0x103200714 0x102cd93dc 0x181581fc0)
libc++abi.dylib: terminating with uncaught exception of type NSException
2018-08-17 11:54:29.263 nsplaydev[1527:448166] PlayLiveSync: Uncaught Exception

Angular, Nebular

Angular version: 6.0.0 Nebular/auth: 2.0.0-rc.10

nnixaa commented 6 years ago

Hey @RodrigoPauletti, I'm not that good with NativeScript, but the error says that you don't have @nebular/theme module installed. Do you have it?

Prefix1802 commented 6 years ago

@nnixaa @RodrigoPauletti

If you look at his code, the folder Theme in @nebular is indeed missing.

RodrigoPauletti commented 6 years ago

@nnixaa @Prefix1802

I'm not using @nebular/theme, because I don't need to use Auth Components. The documentation (https://akveo.github.io/nebular/docs/auth/installation#installation) says, if I don't need to use Auth Components, I don't need to install @nebular/theme:

First, let's install the module as it's distributed as npm package. Make sure you have the Nebular Theme module up and running. Nebular Theme is required to use built-in Auth Components. If you are not going to use those at all, you can use Auth Module without the Nebular Theme module.

nnixaa commented 6 years ago

@RodrigoPauletti, unfortunately, this is not completely true at the moment, so we have to fix the docs. You would need to install the theme module anyway, but this is mostly (mostly - because you still need to install it :/) fine in terms of bundle size, and it doesn't include all of the components (those are separate modules)

Prefix1802 commented 6 years ago

When you look at nebular/src/framework/auth/package.json

"peerDependencies": { "@angular/common": "^6.0.0", "@angular/core": "^6.0.0", "@angular/router": "^6.0.0", "@angular/forms": "^6.0.0", "@angular/http": "^6.0.0", "@nebular/theme": "2.0.0-rc.10", <--- theme is needed "rxjs": "^6.1.0" }

My guess based on this finding is that you need to have theme installed. But i could be wrong.

RodrigoPauletti commented 6 years ago

@nnixaa No problem :) @Prefix1802 Ok. I will install the theme right now and try to build again. Thanks, guys!

RodrigoPauletti commented 6 years ago

@nnixaa @Prefix1802

I install the @nebular/theme now and no more errors appears. Everything is fine. Thanks again!