angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.97k forks source link

Experimental esbuild errors in v14 RC #23154

Closed vzakharov-rxnt closed 2 years ago

vzakharov-rxnt commented 2 years ago

🐞 Bug report

Command (mark with an x)

Is this a regression?

Unknown, feature is new in v14.

Description

Experimental browser-esbuild option gives build errors.

πŸ”¬ Minimal Reproduction

πŸ”₯ Exception or Error

If CSS is part of the build (included in angular.json), getting this error:

X [ERROR] Could not resolve "D:Gitng14-testsrcstyles.css"

    angular:style/global;styles:1:8:
      1 β”‚ @import 'D:\Git\ng14-test\src\styles.css';
        β•΅         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "D:Gitng14-testsrcstyles.css" as external to exclude it from the bundle, which will remove this error.

If I exclude it from angular.json by deleting

"styles": [
  "src/styles.css"
],

getting another error:

An unhandled exception occurred: ENOENT: no such file or directory, open 'D:\Git\ng14-test\dist\ng14-test\D:\Git\ng14-test\main.RY3CYEVR.js'

🌍 Your Environment

Angular CLI: 14.0.0-rc.0
Node: 14.17.1
Package Manager: npm 6.14.13
OS: win32 x64

Angular: 14.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

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
@schematics/angular             14.0.0-rc.0
rxjs                            7.5.5
typescript                      4.6.4

Anything else relevant?

My package.json:

{
  "name": "ng14-test",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "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/router": "14.0.0-rc.0",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "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",
    "@types/jasmine": "~3.10.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~4.0.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.1.0",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.6.2"
  }
}
vzakharov-rxnt commented 2 years ago

I repeated the experiment using the following command:

npx @angular/cli@14.0.0-rc.0 new ng14

Just needs fewer steps to reproduce, but same outcome.

angular-automatic-lock-bot[bot] commented 2 years ago

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.