denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.06k stars 5.23k forks source link

Angular `ng serve` stuck at Building step #22995

Open littledivy opened 6 months ago

littledivy commented 6 months ago

After applying #22994 and #22993:

npx @angular/cli new test-app
cd test-app/

target/debug/deno task start --verbose
 divy@divy-3 ~/g/g/angular-app (main)> ~/gh/deno/target/debug/deno task start --verbose
Task start ng serve "--verbose"
⠋ Building...
✘ [ERROR] this.port.on is not a function [plugin angular-compiler]
littledivy commented 6 months ago

Ref #22951

satyarohith commented 5 months ago

Using build from #23278, the serve throws the same #23263

➜  test-app git:(main) denod task start --verbose
Task start ng serve "--verbose"
⠋ Building...
✘ [ERROR] Angular compilation initialization failed. [plugin angular-compiler]

  TypeError: this.publicInterface.asyncResource.asyncId is not a function
      at ThreadPool.runTask
  (file:///Users/sr/p/test-app/node_modules/.deno/piscina@4.4.0/node_modules/piscina/dist/src/index.js:637:55)
      at Piscina.run
  (file:///Users/sr/p/test-app/node_modules/.deno/piscina@4.4.0/node_modules/piscina/dist/src/index.js:923:65)
      at ParallelCompilation.initialize
  (file:///Users/sr/p/test-app/node_modules/.deno/@angular-devkit+build-angular@17.3.3/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compilation/parallel-compilation.js:89:29)
      at
  file:///Users/sr/p/test-app/node_modules/.deno/@angular-devkit+build-angular@17.3.3/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js:175:68
      at
  file:///Users/sr/p/test-app/node_m
littledivy commented 5 months ago

asyncId fix landed. This is now blocked on #23362

divy@divy-macbook ~/g/angular-app (main)> DENO_FUTURE=1 deno task start --verbose
Task start ng serve "--verbose"
⠙ Building...

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 1.42.3+f36a895
Args: ["/Users/divy/.deno/bin/deno", "run", "--ext=js", "-A", "/Users/divy/gh/angular-app/node_modules/@angular/cli/bin/ng.js", "serve", "--verbose"]

thread 'worker-1' panicked at ext/web/message_port.rs:238:33:
already borrowed: BorrowMutError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
marvinhagemeister commented 5 months ago

Just tried it again and this is the current error I'm getting:

DENO_FUTURE=1 deno task start --verbose
Task start ng serve "--verbose"
⠙ Building...
● [DEBUG] Resolving import "zone.js" in directory "/Users/marvinh/dev/test/deno-angular-2/test-app" of type "import-statement"

  Checking for package alias matches
    Failed to find any package alias matches
  Read 19 entries for directory "/"
  Read 3 entries for directory "/Users"
  Read 71 entries for directory "/Users/marvinh"
  Read 7 entries for directory "/Users/marvinh/dev"
  Read 396 entries for directory "/Users/marvinh/dev/test"
  Read 1 entry for directory "/Users/marvinh/dev/test/deno-angular-2"
  The file "/Users/marvinh/dev/test/deno-angular-2/test-app/package.json" exists
  Read 13 entries for directory "/Users/marvinh/dev/test/deno-angular-2/test-app"
  The file "/Users/marvinh/dev/test/.pnp.cjs" exists
    Extracted JSON data from "/Users/marvinh/dev/test/.pnp.cjs"
  Read 13 entries for directory "/Users/marvinh/dev/test/deno-angular-2/test-app"
  No "browser" map found in directory "/Users/marvinh/dev/test/deno-angular-2/test-app"
  Searching for "zone.js" in "node_modules" directories starting from "/Users/marvinh/dev/test/deno-angular-2/test-app"
    Using Yarn PnP manifest from "/Users/marvinh/dev/test/.pnp.cjs"
      Resolving "zone.js" in "/Users/marvinh/dev/test/deno-angular-2/test-app"
      Parsed bare identifier "zone.js" and module path ""
      Found parent locator: ["test", "workspace:."]
      Found parent package at "./"
      Failed to find "zone.js" in "packageDependencies" of parent package
      Searching for a fallback because "enableTopLevelFallback" is true
        Stopping because ["test", "workspace:."] is in "fallbackExclusionList"
    The Yarn PnP path resolution algorithm returned an error

✘ [ERROR] Could not resolve "zone.js"

    angular:polyfills:angular:polyfills:1:7:
      1 │ import 'zone.js';
        ╵        ~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "zone.js" here because it's not listed as a
  dependency of this package:

    ../../.pnp.cjs:36:31:
      36 │         "packageDependencies": [\
         ╵                                ~~

  You can mark the path "zone.js" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

⠦ Building...

The build process doesn't seem to finish. I'm not sure why it mentions Yarn's Plug'n'Play feature.

littledivy commented 5 months ago

It seems to be stuck on Building... on Linux. I do not get any logs.

~/g/test-app $ DENO_FUTURE=1 deno task start --verbose
Task start ng serve "--verbose"
A new canary release of Deno is available. Run `deno upgrade --canary` to install it.
⠋ Building...
^C⏎ 
littledivy commented 5 months ago

I think its the same bug reported here with Esbuild: https://github.com/denoland/deno/issues/19823

This is where it hangs for one of the files:

Image

https://github.com/angular/angular-cli/blob/c8b1fc045fdb495be4d238eec2c0c25f354e2e91/packages/angular/build/src/tools/esbuild/bundler-context.ts#L219

marvinhagemeister commented 5 months ago

Wondering if it's related to #23281 where parcel is stuck too.