Skip to content

Experimental esbuild errors in v14 RC #23154

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

Closed
1 task done
vzakharov-rxnt opened this issue May 17, 2022 · 2 comments · Fixed by #23203
Closed
1 task done

Experimental esbuild errors in v14 RC #23154

vzakharov-rxnt opened this issue May 17, 2022 · 2 comments · Fixed by #23203

Comments

@vzakharov-rxnt
Copy link

vzakharov-rxnt commented May 17, 2022

🐞 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"
  }
}
@ngbot ngbot bot added this to the needsTriage milestone May 17, 2022
@alan-agius4 alan-agius4 added angular/build:application type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels May 17, 2022
@ngbot ngbot bot modified the milestones: needsTriage, Backlog May 17, 2022
@vzakharov-rxnt
Copy link
Author

I repeated the experiment using the following command:

npx @angular/[email protected] new ng14

Just needs fewer steps to reproduce, but same outcome.

clydin added a commit to clydin/angular-cli that referenced this issue May 18, 2022
The newer version of `babel-loader` contains a fix for its hash function usage
that will cause it to not use MD4 on Node.js versions that no longer support that
hashing algorithm.

Fixes angular#23154
@alan-agius4 alan-agius4 self-assigned this May 23, 2022
alan-agius4 added a commit that referenced this issue May 23, 2022
…build experimental builder

With this change we handle several esbuild path issues in Windows.

Closes #23154
alan-agius4 added a commit that referenced this issue May 23, 2022
…build experimental builder

With this change we handle several esbuild path issues in Windows.

Closes #23154
dgp1130 pushed a commit that referenced this issue May 24, 2022
…build experimental builder

With this change we handle several esbuild path issues in Windows.

Closes #23154
dgp1130 pushed a commit that referenced this issue May 24, 2022
…build experimental builder

With this change we handle several esbuild path issues in Windows.

Closes #23154

(cherry picked from commit 4325995)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants