Closed
Description
/cc @alan-agius4
in beta.7, the core package was published without dts bundling,
https://unpkg.com/@angular/core@8.0.0-beta.7/core.metadata.json:
"exports":[{"export":[{"name":"Type","as":"Type"}],"from":"./src/interface/type"},
...
this allowed us to run ngc
on the node_modules directory to create working ngsummary files.
In beta.8, it changed: https://unpkg.com/@angular/core@8.0.0-beta.8/core.metadata.json
"exports":[{"export":[{"name":"Type","as":"Type"}],"from":"./core"},
...
which expresses a self-referential re-export.
This causes a self-export edge to appear in the ngsummary file as well.
Later, when running ngc, we'll read the bad data from the summary and infinite-loop trying to resolve the re-export
: RangeError: Maximum call stack size exceeded
at String.replace (<anonymous>)
at stripGeneratedFileSuffix (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:18711:25)
at AotSummaryResolver.isLibraryFile (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:26072:44)
at ToJsonSerializer.visitStaticSymbol (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24037:38)
at ToJsonSerializer.visitStaticSymbol (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24046:34)
... more JSON serializing visitor frames...
at ToJsonSerializer.visitStringMap (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24027:52)
at visitValue (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:2453:28)
at ToJsonSerializer.processValue (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24003:20)
at ToJsonSerializer.addSummary (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:23916:50)
at /usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:23947:39
at Array.forEach (<anonymous>)
at ToJsonSerializer.addSummary (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:23941:94)
at /usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:23824:30
at Array.forEach (<anonymous>)
at serializeSummaries (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:23822:15)
at AotCompiler._createSummary (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24685:22)
at AotCompiler._compileImplFile (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24630:69)
at /usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24622:74
at Array.map (<anonymous>)
at AotCompiler.emitAllImpls (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler/bundles/compiler.umd.js:24622:39)
at AngularCompilerProgram.generateFilesForEmit (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler-cli/src/transformers/program.js:619:46)
at AngularCompilerProgram._emitRender2 (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler-cli/src/transformers/program.js:265:47)
at AngularCompilerProgram.emit (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler-cli/src/transformers/program.js:200:25)
at Object.performCompilation (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/compiler-cli/src/perform_compile.js:214:29)
at compile (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/bazel/src/ngc-wrapped/index.js:317:57)
at runOneBuild (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/bazel/src/ngc-wrapped/index.js:113:33)
at Socket.process.stdin.on (/usr/local/google/home/alexeagle/.cache/bazel/_bazel_alexeagle/5c0aaa094e7be03dbabccfd0d5d7e8a8/execroot/angular_bazel_example/bazel-out/host/bin/external/npm/node_modules/@angular/bazel/ngc-wrapped__bin.runfiles/npm/node_modules/@angular/bazel/node_modules/@bazel/typescript/internal/tsc_wrapped/worker.js:113:38)
Metadata
Metadata
Assignees
Labels
No labels
Activity
alexeagle commentedon Mar 14, 2019
Proposed solution is to strip self-referential re-exports when producing the bundled metadata.
I believe the bug is here:
angular/packages/bazel/src/ng_package/packager.ts
Lines 395 to 415 in 1a9ab27
fix(bazel): don't produce self-references in metadata
fix(bazel): don't produce self-references in metadata (angular#29317)
angular-automatic-lock-bot commentedon Sep 14, 2019
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.