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

Error generating ionic-angular application #584

Open
dbvcode opened this issue Dec 27, 2021 · 11 comments
Open

Error generating ionic-angular application #584

dbvcode opened this issue Dec 27, 2021 · 11 comments

Comments

@dbvcode
Copy link

dbvcode commented Dec 27, 2021

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
Copy link

Vishal-Isharani commented Dec 27, 2021

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
Copy link

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
Copy link
Author

dbvcode commented Dec 28, 2021

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
Copy link

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
Copy link
Author

dbvcode commented Dec 29, 2021

@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
Copy link

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
Copy link

thanks a lot!

@devinshoemaker
Copy link
Collaborator

@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
Copy link
Contributor

eduardoRoth commented Jan 3, 2022

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
Copy link

tienne commented Feb 3, 2022

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

@devinshoemaker
Copy link
Collaborator

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

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

No branches or pull requests

7 participants