2

I am following the official tutorial. I am stuck in chapter 3 right now. It is quite weird that I get log like this

Successfully transferred app.routing.ts.
Successfully transferred app.module.ts.
Successfully transferred app.module.js.
Refreshing application...
Successfully synced application org.nativescript.Groceries on device 2CB64AE2-E31B-4B15-ACA5-B501400C2814.
1   0x10dac0d4b NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
2   0x10e16428e ffi_closure_unix64_inner
3   0x10e164bd2 ffi_closure_unix64
4   0x1107f2245 -[UIViewController __viewWillAppear:]
5   0x110833aa2 -[UINavigationController _startTransition:fromViewController:toViewController:]
6   0x11083492f -[UINavigationController _startDeferredTransitionIfNeeded:]
7   0x110835b90 -[UINavigationController __viewWillLayoutSubviews]
8   0x110a8c2ae -[UILayoutContainerView layoutSubviews]
9   0x11071c551 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
10  0x1147524ba -[CALayer layoutSublayers]
11  0x1147565a9 CA::Layer::layout_if_needed(CA::Transaction*)
12  0x1146df1cd CA::Context::commit_transaction(CA::Transaction*)
13  0x11470aae4 CA::Transaction::commit()
14  0x110669706 __34-[UIApplication _firstCommitBlock]_block_invoke_2
15  0x11282c20c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
16  0x112810a3b __CFRunLoopDoBlocks
17  0x112810214 __CFRunLoopRun
18  0x11280fa89 CFRunLoopRunSpecific
19  0x1140179c6 GSEventRunModal
20  0x11064dd30 UIApplicationMain
21  0x10e164a2d ffi_call_unix64
22  0x1353bbc60
file:///app/tns_modules/nativescript-angular/resource-loader.js:23:101: JS ERROR Error: File /Users/zhouyuan/Library/Developer/CoreSimulator/Devices/2CB64AE2-E31B-4B15-ACA5-B501400C2814/data/Containers/Bundle/Application/C64D6180-4E51-4808-9AD5-09E0B329379A/Groceries.app/app/pages/login/pages/login/login.html does not exist. Resolved from: /Users/zhouyuan/Library/Developer/CoreSimulator/Devices/2CB64AE2-E31B-4B15-ACA5-B501400C2814/data/Containers/Bundle/Application/C64D6180-4E51-4808-9AD5-09E0B329379A/Groceries.app/app/pages/login/pages/login/login.html.

I am pretty sure it should be /app/pages/login/login.html but the error says app/pages/login/pages/login/login.html. Anyone knows why this happens?

Penguin Zhou
  • 131
  • 2
  • 10

2 Answers2

1

I guess you are using angular-nativescript from seeing app.routing.ts

in login.ts you can define your component like:

@Component({
  selector: "my-app",
  moduleId: module.id,
  templateUrl: "./login.html"
})

or

@Component({
  selector: "my-app",
  templateUrl: "pages/login/login.html",
})

if you want to use the relative path, add moduleId: module.id

Fetrarij
  • 7,176
  • 3
  • 27
  • 35
0

When you are changing the component name, check carefully you changed everything. I missed out to change html and css name of that component.

Below templateUrl and styleUrls i forgot to change the name.that is what i got the error.

@Component({
    selector: "my-modal",
    templateUrl: "pages/address.modal.html",
    styleUrls: ["pages/address.modal.css"]

})   
Stephen
  • 9,899
  • 16
  • 90
  • 137