nxtend-team / nxtend

MIT License
189 stars 42 forks source link

Error generating ionic-angular application #584

Open dbvcode opened 2 years ago

dbvcode commented 2 years ago

I have added the module: npm install --save-dev --exact @nxtend/ionic-angular npm install --save-dev --exact @nxtend/capacitor Ran: nx generate @nxtend/ionic-angular:application mobile

I am asked which template I would like to use and after selecting tabs, I get this: Cannot set property 'mobile' of undefined

I am using NX 13.4.1 What am I missing? What can be done? Any help is much appreciated.

Vishal-Isharani commented 2 years ago

I'm also getting similar kinds of issues with NX 13.4.1 while adding the ionic-angular app.

Command :- nx generate @nxtend/ionic-angular:application

Error :-

Cannot find module '@nrwl/angular/generators'
SailingBoat762 commented 2 years ago

i just had a similar error

nx generate @nxtend/ionic-angular:application ionicWithNx

but it didn't tell me undefined of what

Cannot set properties of undefined (setting 'ionic-with-nx')

anything can be done here?

dbvcode commented 2 years ago

As a workaround I have created a NX@12 workspace, added the @nxtend/ionic-angular and @nxtend/capacitor to it. Created my app, then upgraded NX to 13 latest version. Then copied the apps in my existing repo and copied their settings into angular.json.

SailingBoat762 commented 2 years ago

As a workaround I have created a NX@12 workspace, added the @nxtend/ionic-angular and @nxtend/capacitor to it. Created my app, then upgraded NX to 13 latest version. Then copied the apps in my existing repo and copied their settings into angular.json.

Could you please share more details about this , I don't understand what that mean

Then copied the apps in my existing repo and copied their settings into angular.json.

dbvcode commented 2 years ago

@tobeFilled open angular.json and look in section projects. Look only at the first level in the json and you will find all the projects in your namespace with all their configs. Copy the objects/lines from your angular.json in your new project for your new mobile app(let's assume it's called mobile) to your old project's angular.json after the ones already existing and save it. You may want to get the e2e tests as well.

After that go to apps folder in your new project and copy mobile and mobile-e2e to your old project's apps folder.

There may be differences in package.json between projects so make sure all that's needed in the new project you also add to your existing(old) project. I copy all the elements in dependencies and paste them in my old project after the existing ones. In VS Code I get prompted of the ones that are already there so I just delete them. Do the same for devDependencies.

Then run npm install in your old project to get them installed and that's it.

You should be able to run npm start mobile with no problems if all is well.

Hope this helps. Good luck!

nhhockeyplayer commented 2 years ago

I have alot of free time in between assignments right now Devin... can I fix this and submit a PR if so be? I would love to help support this schematic if thats ok

please advise and when I reach a lull I can take a peek at this

SailingBoat762 commented 2 years ago

thanks a lot!

devinshoemaker commented 2 years ago

@nhhockeyplayer I am open to a PR if you can pinpoint the problem. That being said, Nx 12 is the only version currently supported and these issues may get resolved on their own when I release an update to support Nx 13 (which is currently in progress).

eduardoRoth commented 2 years ago

The error is in the addProjectToNxJson function, which I can't find anymore in Nx v13, so I guess it got removed from Nx.

TypeError: Cannot set properties of undefined (setting 'empleados')
    at addProjectToNxJson (/Users/eduardoroth/trabajo/projects/apps/alliax/rh-kiosko/node_modules/@nxtend/ionic-angular/node_modules/@nrwl/devkit/src/generators/project-configuration.js:260:42)
    at setProjectConfiguration (/Users/eduardoroth/trabajo/projects/apps/alliax/rh-kiosko/node_modules/@nxtend/ionic-angular/node_modules/@nrwl/devkit/src/generators/project-configuration.js:216:9)
    at Object.updateProjectConfiguration (/Users/eduardoroth/trabajo/projects/apps/alliax/rh-kiosko/node_modules/@nxtend/ionic-angular/node_modules/@nrwl/devkit/src/generators/project-configuration.js:36:5)
    at Object.updateWorkspace (/Users/eduardoroth/trabajo/projects/apps/alliax/rh-kiosko/node_modules/@nxtend/ionic-angular/src/generators/application/lib/update-workspace.js:23:14)
    at /Users/eduardoroth/trabajo/projects/apps/alliax/rh-kiosko/node_modules/@nxtend/ionic-angular/src/generators/application/generator.js:21:28
    at Generator.next (<anonymous>)
    at fulfilled (/Users/eduardoroth/trabajo/projects/apps/alliax/rh-kiosko/node_modules/tslib/tslib.js:114:62)

Temporary workaround

So you can add a new angular app until Nx 13 is officially supported

  1. Go to the @nxtend/ionic-angular folder inside your root node_modules and update @nrwl/devkit to it's latest version (at the moment 13.4.3).
  2. From root, run the command to create a new app: nx generate @nxtend/ionic-angular:application myApp
  3. After it finishes, run the following nx format (if you try to serve your app you'll get an error about project configuration
  4. ng serve your app!

I'll try to make some time to make required changes to @nxtend/ionic-angular so it supports the newest Nx configuration so no nx format is needed and we get full Nx v13 support.

tienne commented 2 years ago

Is there any update on the issue? It's been a month.

devinshoemaker commented 2 years ago

Nxtend 13.0.0 has been released. Let me know if any of you have issues after updating.