Code Monkey home page Code Monkey logo

rules-js-ngc's Introduction

Install

cd angular-app
pnpm i

Reproduce issue

(Note that I have @bazel/[email protected] installed globally via npm)

bazelisk build //angular-app/src/app/mega-menu
(15:04:06) INFO: Current date is 2022-06-28
(15:04:06) INFO: Analyzed target //angular-app/src/app/mega-menu:mega-menu (1 packages loaded, 5 targets configured).
(15:04:06) INFO: Found 1 target...
(15:04:12) ERROR: /Users/andrew/development/work/client/rules-js-ngc/angular-app/src/app/mega-menu/BUILD.bazel:9:18: Compiling TypeScript project //angular-app/src/app/mega-menu:mega-menu [tsc -p angular-app/src/app/tsconfig.json] failed: (Exit 1): ngc.sh failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/angular-app/ngc.sh --project angular-app/src/app/tsconfig.json --outDir angular-app/src/app/mega-menu --rootDir angular-app/src/app/mega-menu --declarationDir ... (remaining 1 argument skipped)

Use --sandbox_debug to see verbose messages from the sandbox
mega-menu/nw-mega-menu.module.ts:7:27 - error NG3004: Unable to import class SharedModule.
  The file /Users/andrew/.cache/bazel/f355b5a713f2f1fa25bb9ca98af4bac6/sandbox/darwin-sandbox/145/execroot/nw-bazel-poc/bazel-out/darwin-fastbuild/bin/angular-app/src/app/shared/shared.module.d.ts is outside of the configured 'rootDir'.

7   imports: [RouterModule, SharedModule],
                            ~~~~~~~~~~~~

  shared/shared.module.d.ts:9:1
      9 export declare class SharedModule {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     10     static ɵfac: i0.ɵɵFactoryDeclaration<SharedModule, never>;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ...
     12     static ɵinj: i0.ɵɵInjectorDeclaration<SharedModule>;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     13 }
        ~
    The class is declared here.
mega-menu/nw-mega-menu.component.html:5:1 - error NG8001: 'nw-button' is not a known element:
1. If 'nw-button' is an Angular component, then verify that it is part of this module.
2. If 'nw-button' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

5 <nw-button></nw-button>
  ~~~~~~~~~~~

  mega-menu/nw-mega-menu.component.ts:5:16
    5   templateUrl: './nw-mega-menu.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component NwMegaMenuComponent.

Target //angular-app/src/app/mega-menu:mega-menu failed to build
Use --verbose_failures to see the command lines of failed build steps.
(15:04:12) INFO: Elapsed time: 6.384s, Critical Path: 5.94s
(15:04:12) INFO: 2 processes: 2 internal.
(15:04:12) FAILED: Build did NOT complete successfully

Test with TSC

It works when using tsc instead of ngc:

  1. Open angular-app/src/BUILD.bazel
  2. Comment out the ng_app_ts_project rule
  3. Un-comment the ts_project rule
  4. Run bazelisk build //angular-app/src/app/mega-menu again, this time it works
(15:04:28) INFO: Current date is 2022-06-28
(15:04:29) INFO: Analyzed target //angular-app/src/app/mega-menu:mega-menu (1 packages loaded, 3 targets configured).
(15:04:29) INFO: Found 1 target...
Target //angular-app/src/app/mega-menu:mega-menu up-to-date:
  bazel-bin/angular-app/src/app/mega-menu/nw-mega-menu.module.js
  bazel-bin/angular-app/src/app/mega-menu/nw-mega-menu.component.js
  bazel-bin/angular-app/src/app/mega-menu/nw-mega-menu.module.js.map
  bazel-bin/angular-app/src/app/mega-menu/nw-mega-menu.component.js.map
(15:04:31) INFO: Elapsed time: 2.422s, Critical Path: 2.00s
(15:04:31) INFO: 2 processes: 1 internal, 1 worker.
(15:04:31) INFO: Build completed successfully, 2 total actions

rules-js-ngc's People

Contributors

alexeagle avatar arobinson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.