Skip to content

esbuild "Could not resolve bootstrap-icons.woff2?###" [plugin angular-css-resource] #25137

@whyboris

Description

@whyboris

Which @angular/* package(s) are the source of the bug?

compiler-cli, compiler, Don't known / other

Is this a regression?

No

Description

Error only happens when I use the esbuild 👌

"builder": "@angular-devkit/build-angular:browser-esbuild",

Error:

✘ [ERROR] Could not resolve "./fonts/bootstrap-icons.woff2?24e3eb84d0bcaf83d77f904c78ac1f47" [plugin angular-css-resource]

    src/styles.scss:11982:11:
      11982 │   src: url("./fonts/bootstrap-icons.woff2?24e3eb84d0bcaf83d77f9...

When running the same exact repository without esbuild:

"builder": "@angular-devkit/build-angular:browser",

No error happens.

Please provide a link to a minimal reproduction of the bug

n/a

Please provide the exception or error you saw

✘ [ERROR] Could not resolve "./fonts/bootstrap-icons.woff2?24e3eb84d0bcaf83d77f904c78ac1f47" [plugin angular-css-resource]

    src/styles.scss:11982:11:
      11982 │   src: url("./fonts/bootstrap-icons.woff2?24e3eb84d0bcaf83d77f9...


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 16.0.0
Node: 18.12.1
Package Manager: npm 9.6.6
OS: darwin arm64

Angular: 16.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1600.0
@angular-devkit/build-angular   16.0.0
@angular-devkit/core            16.0.0
@angular-devkit/schematics      16.0.0
@angular/material               14.2.7
@schematics/angular             16.0.0
rxjs                            7.8.1
typescript                      5.0.4

Anything else?

In package.json I have:

    "bootstrap": "5.2.3",
    "bootstrap-icons": "1.10.5",

In angular.json under the build.options I also have:

"styles": [
        "./node_modules/bootstrap/scss/bootstrap.scss",
        "src/styles.scss"
      ],
"scripts": ["./node_modules/bootstrap/dist/js/bootstrap.bundle.js"]

In my styles.scss I have these imports:

@import "bootstrap";
@import "../node_modules/bootstrap-icons/font/bootstrap-icons";

I'm sorry I'm unsure what of what I list above is relevant to the error I'm seeing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions