Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an angular workspace with appName='app' breaks angular.json #1844

Closed
IgorAufricht opened this issue Sep 16, 2019 · 2 comments · Fixed by #2043
Closed

Creating an angular workspace with appName='app' breaks angular.json #1844

IgorAufricht opened this issue Sep 16, 2019 · 2 comments · Fixed by #2043

Comments

@IgorAufricht
Copy link

Expected Behavior

I should be able to create a workspace with an angular app named "app".

Current Behavior

The workspace gets created, but the angular.json file gets incorrectly modified.

Steps to Reproduce

  1. Run npx create-nx-workspace@8.5.0 nxrepo --preset=angular --cli=angular
  2. Use "app" as the "Application name"
  3. Run ng build

This will fail with:

Schema validation failed with the following errors:
  Data path ".projects['app'].projectType" should be equal to one of the allowed values.

This is because the angular.json file now contains the following:

{
  "version": 1,
  "projects": {
    "app": {
      "projectType": "apps/application",   // <- this
      "schematics": {},
      ...

Other

For what it's worth, I tracked it to the replaceAppNameWithPath function.

@jdpearce
Copy link
Collaborator

Thanks for raising this issue, @IgorAufricht! I think you and I must have found this problem at the same time.

This seems to occur with any application with a name that is contained within the word "application". The same bug will also cause problems for anyone trying to add a library with a name like "lib".

Thanks for tracking down the relevant bit of code!

getabetterpic added a commit to getabetterpic/nx that referenced this issue Nov 10, 2019
Currently when trying to create an app named 'app' or a lib named 'lib', the schematics inject the
'projectType' as 'apps/application' or lib as 'libs/library', breaking the Angular build.

fix nrwl#1844
getabetterpic added a commit to getabetterpic/nx that referenced this issue Nov 10, 2019
Currently when trying to create an app named 'app' or a lib named 'lib', the schematics inject the
'projectType' as 'apps/application' or lib as 'libs/library', breaking the Angular build.

fix nrwl#1844
vsavkin pushed a commit that referenced this issue Nov 11, 2019
Currently when trying to create an app named 'app' or a lib named 'lib', the schematics inject the
'projectType' as 'apps/application' or lib as 'libs/library', breaking the Angular build.

fix #1844
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants