nxext / nx-extensions-ionic

Nx Extension for Ionic
MIT License
32 stars 8 forks source link

Angular: @nxext/ionic-angular:page not working as expected #21

Open m0wglii opened 9 months ago

m0wglii commented 9 months ago

Describe the bug

I have set up an nx workspace as monorepo for creating mobile apps with angular and ionic. I am using the nx generate ui to generate applications and/or pages within applications. Since the generator for applications is working fine, I am not able to generate a page using the generator.

PS D:\dev\ionic\ionic-mono> D:/dev/ionic/ionic-mono/node_modules/.bin/nx.cmd g @nxext/ionic-angular:page --name=login --project=apps-demo-app --no-interactive --verbose

>  NX  Generating @nxext/ionic-angular:page

 >  NX   Cannot read properties of undefined (reading 'parent')

TypeError: Cannot read properties of undefined (reading 'parent')
    at traverse (D:\dev\ionic\ionic-mono\node_modules\@phenomnomnominal\tsquery\dist\src\traverse.js:45:38)
    at traverseChildren (D:\dev\ionic\ionic-mono\node_modules\@phenomnomnominal\tsquery\dist\src\traverse.js:30:5)
    at match (D:\dev\ionic\ionic-mono\node_modules\@phenomnomnominal\tsquery\dist\src\match.js:12:37)
    at query (D:\dev\ionic\ionic-mono\node_modules\@phenomnomnominal\tsquery\dist\src\query.js:12:30)
    at Function.replace (D:\dev\ionic\ionic-mono\node_modules\@phenomnomnominal\tsquery\dist\src\replace.js:8:37)
    at updateAppRoutingModule (D:\dev\ionic\ionic-mono\node_modules\@nxext\ionic-angular\src\generators\page\lib\update-routing-file.js:14:47)
    at D:\dev\ionic\ionic-mono\node_modules\@nxext\ionic-angular\src\generators\page\generator.js:29:58
    at Generator.next (<anonymous>)
    at fulfilled (D:\dev\ionic\ionic-mono\node_modules\tslib\tslib.js:166:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected behavior The command should run successfully and generate a page within my application.

Additional context

PS D:\dev\ionic\ionic-mono> nx report

 >  NX   Report complete - copy this into the issue template

   Node   : 18.18.0
   OS     : win32-x64
   npm    : 9.8.1

   nx (global)        : 17.0.2
   nx                 : 17.1.3
   @nx/js             : 17.1.3
   @nx/jest           : 17.1.3
   @nx/linter         : 17.1.3
   @nx/eslint         : 17.1.3
   @nx/workspace      : 17.1.3
   @nx/angular        : 17.1.3
   @nx/cypress        : 17.1.3
   @nx/devkit         : 17.1.3
   @nx/eslint-plugin  : 17.1.3
   @nrwl/tao          : 17.1.3
   @nx/web            : 17.1.3
   @nx/webpack        : 17.1.3
   typescript         : 5.2.2
   ---------------------------------------
   Community plugins:
   @ionic/angular       : 7.5.2
   @nxext/capacitor     : 17.0.1
   @nxext/ionic-angular : 17.0.1
a1phaZ commented 5 months ago

hi, I faced the same problem. Is there any solution?

m0wglii commented 5 months ago

I did not found any solution yet :(

m8xp0w3r commented 4 months ago

Hi. Faced the same problem. Somebody found a solution?

DominikPieper commented 4 months ago

I rework some parts of the plugin right now. Hopefilly it will be fixed after that

m8xp0w3r commented 4 months ago

@DominikPieper I faced the same issue when running nx serve with the ionic-angular project later. I bypassed the page generation issue by generating an angular component instead of an ionic page and renamed it to page.

AndriiNeverov commented 1 month ago

@m8xp0w3r Just tried with the latest and the following worked fine: nx g page -p mobile-app --directory=pages page1.