Skip to content
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

Cannot use esbuild builder after 17.0.X with Bazel #27556

Open
maximemg opened this issue Apr 29, 2024 · 4 comments
Open

Cannot use esbuild builder after 17.0.X with Bazel #27556

maximemg opened this issue Apr 29, 2024 · 4 comments
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@maximemg
Copy link

maximemg commented Apr 29, 2024

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

bazel, compiler-cli, compiler

Is this a regression?

Yes

Description

Hi, not sure if this is the right place for this.

Basically calling the architect bin with bazel.
It was working fine when updating to 17.0
But since I updated to to 17.1+ there are issues with esbuild

First was main.ts not bein available in the ts compilation (fixed with "preserveSymslinks" :true)

Second is @angular/material cannot be resolved with its path

Repro with 17.0.1

Repro with 17.3.4

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Architect dist/angular failed: (Exit 1): app__js_binary.sh failed: error executing Architect command (from target //:app) bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/app__js_binary.sh angular:build

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
- Building...

angular:build: ✘ [ERROR] Error: The "path" argument must be of type string. Received undefined
  ╷
1 │ @use '@angular/material' as mat;
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src/styles.scss 1:1  root stylesheet [plugin angular-sass]

    angular:styles/global:styles:1:8:
      1 │ @import 'src/styles.scss';
        ╵         ~~~~~~~~~~~~~~~~~


�cFAILURE
Result: {
    "success": false,
    "target": {
        "project": "angular",
        "target": "build"
    }
}

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

Angular CLI: 17.3.4
Node: 18.18.2
Package manager: pnpm 8.4
OS: Ubuntu 22.04

Anything else?

It still compiles correctly with the regular "browser" builder.

@maximemg maximemg changed the title Cannot use builder with version after 17.0.X Cannot use esbuild builder after 17.0.X Apr 29, 2024
@alan-agius4 alan-agius4 transferred this issue from angular/angular Apr 29, 2024
@clydin clydin changed the title Cannot use esbuild builder after 17.0.X Cannot use esbuild builder after 17.0.X with Bazel Apr 29, 2024
@clydin clydin added the needs: investigation Requires some digging to determine if action is needed label Apr 29, 2024
@sessfeld
Copy link

sessfeld commented May 8, 2024

The last version this works was 17.0.3. From 17.0.4 onward this happens, specifically from 0634a4e onward.

From what I can tell, this is caused the build escaping the sandbox. I believe this has to do with the way aspect_rules_js patches fs. There's an issue around the realPathSync call (aspect-build/rules_js#362).

Edit: Disregard the patch I added here earlier, I believe that only makes it worse.

@clydin
Copy link
Member

clydin commented May 8, 2024

Would it be possible to try the latest v18 release candidate to see if this resolves the problem (currently v18.0.0-rc.2)?

@sessfeld
Copy link

sessfeld commented May 8, 2024

I gave it a quick try and it doesn't resolve the problem.

@maximemg
Copy link
Author

maximemg commented May 9, 2024

Would it be possible to try the latest v18 release candidate to see if this resolves the problem (currently v18.0.0-rc.2)?

Branch with 18.0.0-rc

I used the 'browser-esbuild' since the 'application' doesn't seem to exist anymore.
Anyway it doesn't seems to be better with or without 'preserveSymlinks'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

3 participants