xplat: workspace.json problems
Hi,
BUG 1: In the latest version 8 if a new Ionic app is created. Cannot start live reload due to missing angular.json file in app directory(apps/ionic-myapp). It must be created manually with separate configuration.
$ cd apps/ionic-myapp && ionic capacitor run ios --livereload --address=0.0.0.0
> ng run app:serve --host=0.0.0.0 --port=8100
[ng] The run command requires to be run in an Angular project, but a project definition could not be found.
Question 1: Also i would like to know what is purpose of renaming angular.json to workspace.json? Angular console and commands like ng xi18n stoped working because of that.
ng xi18n
The xi18n command requires to be run in an Angular project, but a project definition could not be found.
Question 2 / Bug2: If i rename workspace.json to angular.json, Angular console and commands start to work, but im getting error with xi18n
ERROR in Unexpected value 'McbIonicCoreModule in .../myapp/xplat/ionic/core/core.module.ts' imported by the module 'CoreModule in .../myapp//apps/ionic-myapp/src/app/core/core.module.ts'. Please add a @NgModule annotation.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 16 (3 by maintainers)
Hi, yes i tried both NX and NG. with NX there is just info that it will forwad to angular CLI.
I noticed that problem is not related just to xi18n, but it is also impossible to run build command with --prod flag.
Im trying that on new project. Step to reproduce:
This will be solved when Nrwl merges this pr
Hi @Brandejs and @NathanWalker . I came across a similar issue as described here and found the solution in a closed issue. My issue was specifically related to running ionic production builds.
I had previously renamed the workspace.json file to angular.json in order to run ionic commands if required so i duplicated the file back into workspace.json (I now have both workspace.json and angular.json files in the ionic directory with the same contents to allow nx and ionic commands to run).
My solution:
Update the ionic app package.json file to only import dependencies that have not been included as a dependency in the root package.json file
run (within the ionic app directory)
then (from the root level)
I suspect the issue was being caused by duplicate packages being added during the build process if they are specified at the root and at the app level (even if the app level package.json file includes them using file:// url’s). Maybe this could be documented? I will see if I can submit a PR with the README change if you can confirm that this is in fact the issue.