nativescript-angular
nativescript-angular copied to clipboard
Angular CLI generate results in 'Project is not configured for NativeScript, while --web is set to false'
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 7.0.0
- Cross-platform modules: None
- Android Runtime: None
- iOS Runtime: None
- Plugin(s): None
- NativeScript-Angular: ~10.0.0
- Angular: ~10.0.0
Describe the bug
When generating a angular building block using the Angular CLI i get a message:
Project is not configured for NativeScript, while --web is set to false
To Reproduce
Create a new app from the empty 7.0.0 template
tns create test-app --template @nativescript/template-blank-ng
Install the Angular CLI and Schematics as noted on the site Angular CLI
npm i --save-dev @angular/cli
npm i --save-dev @nativescript/schematics
Generate a module using the Angular CLI
ng generate module test
Expected behavior
A module names test.module.ts should be create in the folder.
Sample project No sample project.
Additional context This is done using a clean project created using the empty template and no additional work was done prio to this issue.
Same issue here!!
is it the folder schema that has be changed?
Did you find a fix?
Same issue here ++
No resolution yet unfortunately. Already updated all packages but still the error.
I took a sledge hammer to it. Backed up src directory, uninstalled angular cli, native script and node.js, reinstalled node.js, native script and angular cli, created a new nativescript angular project using the tns create command and copied in my src directory. I'm able to lauch the app but the tns g c command does not work, but i'll get over that.
Hi @JasonTomahawk ... then you actually still have the issue that is reported here :). The fact that ng generate <buildingblock> is not working right?
Hi @martijnvanschie here's an alternative extension https://marketplace.visualstudio.com/items?itemName=joshdsommer.vscode-add-angular-native-files. Would still like to fix the underlying issue
Hi... same error with me... this is because on the new Nativescript CLI v7... it no longer uses "nsconfig.json", so that's why we get this message:
nsconfig.json not found. Assuming this is a {N} only project Project is not configured for NativeScript, while --web is set to false
Nativescript Team please fix the @nativescript/schematics to be able to use the new config file "nativescript.config.js"
@JasonTomahawk thank... installed it. Its usefull but still limited. But is speeds up the process of manually adding the files.
Same Issue here ++ It takes a lot of time when I have to create files manually for code sharing project ( web and mobile ).
It can be fixed by adding "nativescript" key in your package.json
package.json:
{
...
"nativescript": {
"id": "org.organization.app"
},
...
}
Please, keep in mind that in previous versions "nativescript" key has more information than that, so you might need to add more info in order to keep other features working - what I am addressing here is just ng g c component command.
Btw - I started using Nativescript to build a new app just a few days ago and already have run into numerous problems with. In the beginning, I was VERY excited but it seems to almost be an abandoned project without anyone taking proper care of it, so just a word of advice from me - if you are here and try to use it in something else than a small project without a clear deadline I would strongly reconsider. Versioning is all over the place and you need to fix and patch things until it works, there is no clear instruction about what is the current way of doing things - some features are just broken and not working at all. I'm sticking with it just for the sake of my small hobby project.
I kinda agree on your statement. Been running into a lot of small issues. Sometime due to not understanding the Framework but also sometime because of issues not being described, addressed or even known. It's an open project so i can't complain to much as it is being maintained by others.
Been thinking of digging into the plain XML version as i still feel that the mutitarget part is really strong.
Will try your fix soon and let you know :)
I've installed the current latest @nativescript/[email protected] now the ng commands work. Thanks NativeScript team.
Of course i wanted to try this ASAP but now i get the following error message :(
❯ ng g component tab2
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
Glad it worked for you though @Ziggymusician :)
entryComponents and ANALYZE_FOR_ENTRY_COMPONENTS no longer required... But not sure why you got an error because it's still in deprecation, not yet removed. But try removing entryComponents or try to find out what is accessing 'kind' and fix that.
https://angular.io/guide/deprecations
Can only find reference to entryComponents in vendor.js. Dunno what's wrong. Will check later.
oh the agony
Okay cool... good luck
It can be fixed by adding "nativescript" key in your package.json
package.json:
{ ... "nativescript": { "id": "org.organization.app" }, ... }
This worked for me.
Please anyone with widely used solution, I have install angular-cli, schematics both global and dev-dependencies locally on the app but still getting this
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
Please anyone with widely used solution, I have install angular-cli, schematics both global and dev-dependencies locally on the app but still getting this
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary. Cannot read property 'kind' of undefined
I have the exact same issue, any solution?
@martijnvanschie did you happen to find a solution to your secondary issue?
❯ ng g component tab2
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
Solution that worked for me:
Updating the typescript devDependency from 3.9.0 to 4.0.3 and running ng g c [directory-name] --skip-import
@MegganKNaude nope, not seen this working. Just checked again on a project where i actually updated all packages to the latest but still the entryComponent error.
@MegganKNaude Thanks, it worked, still need to:
Install:
- @angular/cli
- @nativescript/schematics
- @schematics/angular
- typescript: 4.0.3
Add
"nativescript": {
"id": "com.organizaton.app"
}
Example
"devDependencies": {
"@angular/cli": "^10.1.7",
"@angular/compiler-cli": "~10.1.0",
"@nativescript/schematics": "^10.1.0",
"@nativescript/types": "~7.0.0",
"@nativescript/webpack": "~3.0.0",
"@ngtools/webpack": "~10.1.0",
"@schematics/angular": "^10.1.7",
"tslint": "^6.1.3",
"typescript": "^4.0.3"
},
"nativescript": {
"id": "com.organizaton.app"
}
Than run ng g c <Component name> --skip-import.