Skip to content

Experimental esbuild errors in v14 RC #23154

Closed
@vzakharov-rxnt

Description

@vzakharov-rxnt

🐞 Bug report

Command (mark with an x)

  • build

Is this a regression?

Unknown, feature is new in v14.

Description

Experimental browser-esbuild option gives build errors.

🔬 Minimal Reproduction

  • Create Angular boilerplate project with ng new, using CSS and routing. My global CLI version is v13.3.3.
  • Change Angular versions in package.json to 14.0.0-rc.0.
  • Run npm install.
  • Change builder option in angular.json to @angular-devkit/build-angular:browser-esbuild.
  • Run "build": "ng build",.

🔥 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"
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions