Skip to content

Angular-CLI 14.0.0-rc.0 failed to generate new component #23141

Closed

Description

@s-triar

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was:

I don't know. the tutorial angular 14 especially for a standalone component on youtube shows that the angular-cli is working perfectly.

Description

After run npm i -g @angular/cli@next to trying angular 14 RC, the angular-cli is failed to generate component using ng g component <name-component>

🔬 Minimal Reproduction

I am using windows 10.

  1. Upgrade angular-cli to 14 rc using npm i -g @angular/cli@next
  2. Create new project ng new <name-project>
  3. Generate new component using ng g component <name-component>

below is the package.json I am currently using.

{
  "name": "berdikari",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "dev:ssr": "ng run berdikari:serve-ssr",
    "serve:ssr": "node dist/berdikari/server/main.js",
    "build:ssr": "ng build && ng run berdikari:server",
    "prerender": "ng run berdikari:prerender"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.0.0-rc.0",
    "@angular/cdk": "^14.0.0-rc.0",
    "@angular/common": "^14.0.0-rc.0",
    "@angular/compiler": "^14.0.0-rc.0",
    "@angular/core": "^14.0.0-rc.0",
    "@angular/forms": "^14.0.0-rc.0",
    "@angular/platform-browser": "^14.0.0-rc.0",
    "@angular/platform-browser-dynamic": "^14.0.0-rc.0",
    "@angular/platform-server": "^14.0.0-rc.0",
    "@angular/router": "^14.0.0-rc.0",
    "@angular/service-worker": "^14.0.0-rc.0",
    "@fortawesome/angular-fontawesome": "^0.10.2",
    "@nguniversal/express-engine": "^14.0.0-rc.0",
    "@zxing/browser": "^0.0.5",
    "@zxing/library": "^0.18.3",
    "@zxing/ngx-scanner": "3.1.3",
    "angular-oauth2-oidc": "^13.0.1",
    "angular-oauth2-oidc-jwks": "^13.0.1",
    "aspnet-prerendering": "^3.0.1",
    "express": "^4.15.2",
    "jwt-decode": "^3.1.2",
    "ng-thermal-print": "^1.0.3",
    "ngx-image-compress": "^11.0.3",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "uuid": "^8.3.2",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.0.0-rc.0",
    "@angular/cli": "~14.0.0-rc.0",
    "@angular/compiler-cli": "^14.0.0-rc.0",
    "@angular/language-service": "^14.0.0-rc.0",
    "@nguniversal/builders": "^14.0.0-rc.0",
    "@tailwindcss/aspect-ratio": "^0.4.0",
    "@tailwindcss/forms": "^0.5.1",
    "@tailwindcss/line-clamp": "^0.4.0",
    "@tailwindcss/typography": "^0.5.2",
    "@types/express": "^4.17.0",
    "@types/jasmine": "~4.0.0",
    "@types/node": "^14.15.0",
    "@types/uuid": "^8.3.3",
    "@types/w3c-web-serial": "^1.0.2",
    "@types/w3c-web-usb": "^1.0.5",
    "@types/web-bluetooth": "0.0.12",
    "autoprefixer": "^10.4.7",
    "jasmine-core": "~4.1.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "postcss": "^8.4.13",
    "tailwindcss": "^3.0.24",
    "tailwindcss-children": "^2.1.0",
    "typescript": "~4.6.2"
  }
}

🔥 Exception or Error


An unexpected error occurred: {}

image

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 14.0.0-rc.0
Node: 16.13.1
Package Manager: npm 8.1.2
OS: win32 x64

Angular: 14.0.0-rc.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1400.0-rc.0
@angular-devkit/build-angular   14.0.0-rc.0
@angular-devkit/core            14.0.0-rc.0
@angular-devkit/schematics      14.0.0-rc.0
@nguniversal/builders           14.0.0-rc.0
@nguniversal/express-engine     14.0.0-rc.0
@schematics/angular             14.0.0-rc.0
rxjs                            7.5.5
typescript                      4.6.4

Activity

  1. alan-agius4 commented on May 16, 2022

    @alan-agius4
    Collaborator

    I'm sorry, but we can't reproduce the problem following the instructions you provided.

    Can you setup a minimal repro please?

    You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

    This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

  2. added
    needs: repro steps
    on May 16, 2022
  3. dzhavat commented on May 16, 2022

    @dzhavat

    I just experienced the same error. My repo is here https://github.com/dzhavat/angular-standalone-components

    Running ng version gives me this

    image

  4. self-assigned this
    on May 16, 2022
  5. added
    freq1: low
    and removed
    needs: repro steps
    on May 16, 2022
  6. added this to the needsTriage milestone on May 16, 2022
  7. modified the milestones: needsTriage, Backlog on May 16, 2022
  8. s-triar commented on May 17, 2022

    @s-triar
    Author

    for some reason. ng g directive <name-dir> also has the same error

    image

  9. added 3 commits that reference this issue on May 17, 2022
    f53c6dd
    f3e2969
    f2764c6
  10. s-triar commented on May 17, 2022

    @s-triar
    Author

    When I change the file according to f2764c6

    it happened because there is more than 1 module.

  11. added 2 commits that reference this issue on May 17, 2022
    f00da00
    bdf2b9b
  12. angular-automatic-lock-bot commented on Jun 17, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  13. locked and limited conversation to collaborators on Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/clifreq1: lowseverity5: regressiontype: bug/fix

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions