Skip to content

Angular 15 - esbuild not building #24356

Closed

Description

@masterworgen

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I tried build my angular 15 application with esbuild, but i get error`s


    src/app/static/utils/dateTimeUtils.ts:9:20:
      9 │   const localDate = dayjs(utcDate).local().format(format);
        ╵                     ~~~~~

  Consider changing "dayjs" to a default import instead:

    src/app/static/utils/dateTimeUtils.ts:2:7:
      2 │ import * as dayjs from 'dayjs';
        │        ~~~~~~~~~~
        ╵        dayjs


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import 'src/assets/styles/mixins';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\form-controls\abstract\form-input-base\form-input-base.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import "src/app/shared/components/form-controls/abstract/form-input-base/form-input-base.component";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\workplace-wrapper\components\workplace-wrapper-side-section\workplace-instruments\components\workplace-instruments-modal\workplace-instruments-modal.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import "src/assets/styles/variables";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\workplace-wrapper\components\workstation-wrapper-order-section\components\workstation-pipes-counter\workstation-pipes-counter.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import "src/assets/styles/mixins";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\workplace-wrapper\components\workstation-wrapper-order-section\workstation-wrapper-order-section.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import "src/assets/styles/variables";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\panel\panel.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import 'src/assets/styles/variables';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\workplace-wrapper\components\workplace-wrapper-side-section\workplace-wrapper-side-section.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import 'src/assets/styles/mixins';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\package-info\package-info.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import "/src/assets/styles/mixins";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\pages\workplaces-main\pages\sleeve\components\screw-up-arm\screw-up-arm.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import 'src/assets/styles/mixins';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\package-info\package-modal\package-modal.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import 'src/assets/styles/variables';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\shared\components\workplace-wrapper\components\workplace-wrapper-side-section\workplace-wrapper-side-section.component.scss 1:9               @import
  src\app\shared\components\workplace-wrapper\components\workplace-wrapper-side-section\workplace-instruments\workplace-instruments.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import "src/assets/styles/variables";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\api\components\nav-menu\nav-menu.component.scss 1:9  root stylesheet


X [ERROR] [plugin angular-sass] Can't find stylesheet to import.
  ╷
1 │ @import 'src/assets/styles/mixins';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\app\pages\workplaces-main\pages\sleeve\components\screw-up-arm\components\screw-up-info\screw-up-info.component.scss 1:9  root stylesheet

Minimal Reproduction

ng build

Exception or Error

No response

Your Environment

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.2
@angular-devkit/build-angular   15.0.2
@angular-devkit/core            15.0.2
@angular-devkit/schematics      15.0.2
@schematics/angular             15.0.2
rxjs                            7.5.7
typescript                      4.8.4

Anything else relevant?

No response

Activity

  1. changed the title [-]esbuild not building[/-] [+]Angular 15 - esbuild not building[/+] on Dec 1, 2022
  2. clydin commented on Dec 1, 2022

    @clydin
    Member

    Thank you for trying out the new esbuild-based builder.

    The Sass imports are failing due to their reliance on a Webpack specific behavior that attempts to resolve relative stylesheet imports from the workspace root. While this behavior currently works with Webpack, it is also not guaranteed to work in the future.
    However, if this type of Sass stylesheet import is useful for the project, it can be opted in by adding an style preprocessor include path entry for the workspace root to the build options for the project:

                "stylePreprocessorOptions": {
                  "includePaths": ["."]
                }
    

    This will also work for the default Webpack based builder.

  3. masterworgen commented on Dec 1, 2022

    @masterworgen
    Author

    @clydin Thanks you!
    Its work for me.
    I get boost build project 65500ms to 16.824 sec!

    webpack:

    √ Browser application bundle generation complete.
    √ Copying assets complete.
    √ Index html generation complete.
    
    Initial Chunk Files           | Names                                                          |  Raw Size | Estimated Transfer Size
    styles.7a8ac3d035f2587f.css   | styles                                                         | 734.75 kB |                70.81 kB
    main.cc408b18621a7ead.js      | main                                                           | 497.64 kB |               115.51 kB
    polyfills.4480ad792eb775e0.js | polyfills                                                      |  33.09 kB |                10.69 kB
    runtime.8b1ffcad5ac88708.js   | runtime                                                        |   3.34 kB |                 1.58 kB
    
                                  | Initial Total                                                  |   1.24 MB |               198.59 kB
    
    Lazy Chunk Files              | Names                                                          |  Raw Size | Estimated Transfer Size
    791.f663f3ecccb70a77.js       | pages-authorization-authorization-module                       |   6.47 MB |                 1.19 MB
    433.a2a922e7eda6b1a4.js       | pages-authorization-authorization-module                       |  36.93 kB |                 7.89 kB
    326.0fd0b2849d8aaf10.js       | pages-workplaces-main-pages-admin-admin-module                 |  21.82 kB |                 4.48 kB
    8.b39a4d08ca951a71.js         | pages-workplaces-main-pages-sleeve-screw-up-module             |  21.50 kB |                 4.13 kB
    34.5d1f09c745da1baa.js        | pages-workplaces-main-workplaces-main-module                   |  20.75 kB |                 6.27 kB
    31.2ec8668bdb1ddf20.js        | pages-workplaces-main-pages-sleeve-screw-up-module             |  15.93 kB |                 3.97 kB
    262.f2e18cc0d9d6d35a.js       | pages-workplaces-main-pages-templating-templating-module       |  13.98 kB |                 2.97 kB
    389.d660761266c291f9.js       | pages-authorization-authorization-module                       |   2.31 kB |               917 bytes
    557.1eb4e738c553d5b5.js       | pages-workplaces-main-pages-hydro-testing-hydro-testing-module | 902 bytes |               434 bytes
    
    Build at: 2022-12-01T16:52:49.985Z - Hash: e473670b059422ac - Time: 65500ms
    

    esbuild:

    The esbuild browser application builder ('browser-esbuild') is currently experimental.
    The 'budgets' option is currently unsupported by this experimental builder and will be ignored.
    The 'extractLicenses' option is currently unsupported by this experimental builder and will be ignored.    
    The 'progress' option is currently unsupported by this experimental builder and will be ignored.
    The 'inlineStyleLanguage' option is currently unsupported by this experimental builder and will be ignored.
    ▲ [WARNING] Calling "dayjs" will crash at run-time because it's an import namespace object, not a function [call-import-namespace]
    
        src/app/static/utils/dateTimeUtils.ts:9:20:
          9 │   const localDate = dayjs(utcDate).local().format(format);
            ╵                     ~~~~~
    
      Consider changing "dayjs" to a default import instead:
    
        src/app/static/utils/dateTimeUtils.ts:2:7:
          2 │ import * as dayjs from 'dayjs';
            │        ~~~~~~~~~~
            ╵        dayjs
    
    
    Complete. [16.824 seconds]
    
  4. clydin commented on Dec 1, 2022

    @clydin
    Member

    Great to hear.

    If you encounter any other problems with the new builder, please let use know by opening a new issue.

  5. self-assigned this
    on Dec 2, 2022
  6. angular-automatic-lock-bot commented on Jan 2, 2023

    @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.

  7. locked and limited conversation to collaborators on Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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