Skip to content

Experimental esbuild errors in v14 RC #23154

Closed

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

Activity

  1. added this to the needsTriage milestone on May 17, 2022
  2. added
    freq1: low
    on May 17, 2022
  3. modified the milestones: needsTriage, Backlog on May 17, 2022
  4. vzakharov-rxnt commented on May 17, 2022

    @vzakharov-rxnt
    Author

    I repeated the experiment using the following command:

    npx @angular/[email protected] new ng14
    

    Just needs fewer steps to reproduce, but same outcome.

  5. added a commit that references this issue on May 18, 2022
    c8cfa89
  6. self-assigned this
    on May 23, 2022
  7. added 2 commits that reference this issue on May 23, 2022
    9adf856
    5ca2e1d
  8. added 2 commits that reference this issue on May 24, 2022
    4325995
    72e820e
  9. angular-automatic-lock-bot commented on Jun 24, 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.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions