Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Lazy loading from common folder #983

Open
stephaneHillerCGI opened this issue Mar 7, 2019 · 2 comments
Open

Lazy loading from common folder #983

stephaneHillerCGI opened this issue Mar 7, 2019 · 2 comments
Labels

Comments

@stephaneHillerCGI
Copy link

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request

Current behavior:

I have a repo with three folder : 2 ionic apps and a common module. The goal of this common module is to provide common information for the two ionic projects (the module contains providers, component, models, pages, ...).

But when you try to lazy load a page from the module, it doesn't work ("core.js:1350 ERROR Error: Uncaught (in promise): invalid link: MyPage").

ps: my current ionic version is 4.11, but it's an Ionic v3 application.

Expected behavior:

The expected behaviour would be a working lazy loading.

Steps to reproduce:

https://github.com/stephaneHillerCGI/ionicCommonModule

Clone github repo and run npm install on each of the three folder. After that you can run ionic serve from both folder ionicProjectA and ionicProjectB.

The two pages that will be displayed will be the same (a button "My component" and a button "Launch"). Press "Launch" to navigate to another page. In project A it doesn't work (because of live reload) and in project B, it works (no live reload). To switch from live reload to no live reload, just comment/uncomment the lines in (my-page.module.ts, my-page.ts and my-module.module.ts).

Related code:

The code of the application can be clone from : https://github.com/stephaneHillerCGI/ionicCommonModule

Other information:

Is it possible that Ionic doesn't "see" the IonicPage() annotation because this annotation isn't in the src folder ? If true, is it possible to extends the watcher to another folder so Ionic can recognize the annotation ?

   ionic (Ionic CLI)  : 4.11.0 (C:\Users\stephane.hiller\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.0

System:

   NodeJS : v8.9.4 (C:\Program Files\nodejs\node.exe)
   npm    : 5.6.0
   OS     : Windows 7
@ionitron-bot ionitron-bot bot added the triage label Mar 7, 2019
@longgt
Copy link

longgt commented Mar 8, 2019

The default setup of Ionic Appscript is it will look into src folder. So if Lazy Loading page is out of here, it can't be parsed and inject into module loader properly.

If you need support this feature, feel free to file issue to Ionic app scripts.

https://github.com/ionic-team/ionic-app-scripts

@stephaneHillerCGI
Copy link
Author

@longgt Thanks for your answer. I've open an issue in the Ionic app scripts github. Here is the link if anyone is interessed by the response : ionic-team/ionic-app-scripts#1520

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants