14158 Commits

Author SHA1 Message Date
Alan Agius
a64d8edfd6 fix(@angular-devkit/build-angular): add a maximum rendering timeout for SSR and SSG during development
There might be cases were currently, the render application promise does not resolve because the application never becomes stable in most cases this is due to errors, this causes the worker to never exit and the build to keep running until it's manually terminated.

With this change, we add a maximum rendering timeout of 30seconds for each page.
2023-10-27 09:28:29 -07:00
Doug Parker
aa9f0528f1 docs: release notes for the v17.0.0-rc.2 release 2023-10-26 11:43:47 -07:00
Charles Lyding
c5827d412f fix(@schematics/angular): allow dash in selector before a number
This commit updates the validator regexp to allow a dash before a number.

Closes #25164
2023-10-26 16:58:21 +02:00
Angular Robot
1644566043 build: lock file maintenance 2023-10-26 16:51:40 +02:00
Angular Robot
8516ab885b build: update dependency ng-packagr to v17.0.0-rc.0 2023-10-26 16:34:03 +02:00
Alan Agius
a0f8fac4b3 refactor: update inquirer to version 9.0.6
Update the mentioned package.
2023-10-26 16:11:36 +02:00
Alan Agius
8178c23c88 fix(@angular-devkit/build-angular): handle HTTP requests to assets during SSG in dev-server
This commit fixes an issue were during SSG/SSR in the dev-server http requests to assets causes the page rendering to fail.
2023-10-26 16:01:39 +02:00
Charles Lyding
4bc6debdd5 perf(@angular-devkit/build-angular): only rebundle global scripts/styles on explicit changes
The newly introduced incremental bundler result caching is now used for both global styles
(`styles` option) and global scripts (`scripts` option). This allows the bundling steps
to be skipped in watch mode when no related files for either have been modified. This
can be especially beneficial for applications with large global stylesheets.
2023-10-26 14:59:17 +02:00
cexbrayat
62a7019a47 fix(@angular-devkit/build-angular): ensure that externalMetadata is defined
`ng serve` might fail with: `Cannot read properties of undefined (reading 'explicit')` because `result.externalMetadata` is optional.
This commit guards the access and should fix the issue related to the fix 9768c184e0
2023-10-26 14:59:04 +02:00
Charles Lyding
142a36a99f refactor(@angular-devkit/build-angular): prevent vite from resolving explicit external dependencies
When using the Vite-based development server combined with the `externalDependencies` option, Vite
will no longer attempt to resolve the explicitly marked externals.
This is still not ideal since it vite will still transform the import specifier to `/@id/${source}`
but is currently closer to a raw external than a resolved file path. Further investigation with
a possible feature request for Vite may be needed to achieve the desired outcome of an unresolved
and untransformed external import specifier.
2023-10-26 14:58:53 +02:00
Charles Lyding
cdea51865a fix(@angular-devkit/build-angular): avoid binary content in architect results with browser-esbuild
The builder system (architect) currently attempts to treat all results as JSON and
attempts to validate the object with a JSON schema validator. This can lead to slow
build completion (even after the actual build is fully complete) or crashes if the
size and/or quantity of output files is large. Architect only requires a `success`
property so that is all that will be passed here if the infrastructure settings have
not been explicitly set to avoid writes. Writing is only disabled when used directly
by the dev server which bypasses the architect behavior.
2023-10-26 14:58:40 +02:00
Alan Agius
82f855049f perf(@angular-devkit/build-angular): remove JavaScript transformer from server polyfills bundling
This is no longer needed as the server polyfills file there are no longer Angular deps that require to be "linked".
2023-10-26 13:47:55 +02:00
Angular Robot
405b2ccada build: update dependency sass to v1.69.5 2023-10-26 13:06:56 +02:00
Alan Agius
62d26db17c fix(@angular-devkit/build-angular): do not perform advanced optimizations on @angular/common/locales/global
This entry-points are side effectful.
2023-10-26 13:06:30 +02:00
Angular Robot
6fbe520a9e build: update angular 2023-10-26 10:48:10 +02:00
Doug Parker
59e5f56802 docs: release notes for the v17.0.0-rc.1 release 2023-10-25 13:37:09 -07:00
Doug Parker
57d9dab85f docs: release notes for the v16.2.8 release 2023-10-25 10:56:38 -07:00
Angular Robot
58c06d4d23 build: update ossf/scorecard-action action to v2.3.1 2023-10-25 12:52:58 +02:00
Charles Lyding
9768c184e0 fix(@angular-devkit/build-angular): automatically include known packages in vite prebundling
When using the Vite-based development server, the application build step already contains the
list of known packages that would need to be prebundled. This information can be passed to Vite
directly to avoid Vite needing to perform discovery on every output file that will be requested.
This also avoids the Vite server behavior where Vite forces a reload of the page when it discovers
a new dependency. This behavior can result in lost state during lazy loading of a route.
2023-10-25 12:52:46 +02:00
Charles Lyding
ca4426150f fix(@angular-devkit/build-angular): normalize paths when invalidating stylesheet bundler
To avoid incorrectly invalidating the stylesheet bundler within the application builder
on Windows, the paths of changed files are now first normalized. This ensures that any
changed files properly cause affected component stylesheets to be reprocessed.
2023-10-25 12:52:35 +02:00
Charles Lyding
f7130ef639 build: disable inline sourcemap generation
The built packages that will be published on npm previously contained inlined
sourcemaps for every JavaScript file. This caused a significant increase in the
overall package size of over two times larger. This has a negative effect on
developer experience especially the new project experience due to the increase
time to download and setup a new project. The sourcemaps are also rarely used
as debugging the CLI code itself is typically done with development builds.
The generated code is also very close to the original source due to it being
emitted as ES2022 code and with the eventual switch to ESM output this will
become even closer.
As an example of the size difference, the `@angular/cli` compressed package size
was reduced from ~352Kb to ~115Kb with this change.
2023-10-25 12:52:14 +02:00
Angular Robot
b2cc49cbf2 build: lock file maintenance 2023-10-25 12:52:02 +02:00
Alan Agius
5b3541040b fix(@angular-devkit/build-angular): handle HTTP requests to assets during prerendering
This commit fixes an issue were during prerendering (SSG) http requests to assets causes prerendering to fail.

Closes #25720
2023-10-25 12:45:11 +02:00
Charles Lyding
26c3b82fc9 refactor(@angular-devkit/build-angular): increase JS transformer worker pool idle timeout to 1 second
The idle timeout for threads in the JavaScript transformer worker pool for the esbuild-based builders
(`application`/`browser-esbuild`) is now set at 1 second. This prevents the default of immediate shutdown
of an idle worker from occurring. The immediate shutdown causes additional worker threads to be created
due to the variable time between bundler requests for node module JavaScript files. The shutdown and
subsequent recreation of the threads during the build causes unneeded extra processing that can now be
avoided.
2023-10-24 08:51:37 -07:00
Charles Lyding
902089044b perf(@angular-devkit/build-angular): fully avoid rebuild of component stylesheets when unchanged
With the full set of dependencies and watch files tracked within the bundler context object for
component stylesheets, the entire bundler output can be cached in memory and reused when none of
the relevant files have changed since the last rebuild. This is particularly useful for scenarios
when a large tree of components are considered affected and must be recompiled by the AOT compiler.
2023-10-24 08:51:22 -07:00
Alan Agius
842c2045d1 fix(@angular/cli): remove Node.js 16 from supported checks
Node.js support was removed, but it appears that this got through the cracks.
2023-10-24 16:12:09 +02:00
Alan Agius
6067f8577d fix(@angular-devkit/build-angular): silence xhr2 not ESM module warning
This is used inernally by '@angular/platform-server' and is in a seperate chunk that is unused when using `provideHttpClient(withFetch())`.
2023-10-24 16:11:56 +02:00
Alan Agius
f6a088bc18 fix(@angular/ssr): correctly set config URL
When calling `renderApplication` or `renderModule` the URL would be overridden to undefined as the `url` option was not provided as an option.
2023-10-24 16:11:45 +02:00
Angular Robot
65a26609d3 build: update angular 2023-10-23 16:32:32 -07:00
Angular Robot
9ff696f626 build: update all non-major dependencies 2023-10-23 16:31:52 -07:00
Angular Robot
f49093e3f8 build: update github/codeql-action action to v2.22.4 2023-10-23 16:31:29 -07:00
Charles Lyding
175ad37d6e fix(@angular-devkit/build-angular): warn if using partial mode with application builder
The Angular compiler's partial compilation mode is only intended for use when building libraries.
If attempting to use the mode while building an application, the application would fail. A warning
is now issued if partial mode is configured for the application and the mode is switched to full
compilation mode to prevent the build from failing due to the option value.
2023-10-23 16:30:49 -07:00
Charles Lyding
df1aba1ea4 fix(@angular-devkit/build-angular): ensure css url() prefix warnings support Sass rebasing
The stylesheet url() resource plugin will now correctly issue warnings for the usage of Webpack
specific prefixes such as the tilde when used in an imported Sass file. Previously, these URLs
would be rebased by the Sass processing step which would cause the tilde prefix to no longer
be a prefix. This would then no longer be considered a warning due to the tilde no longer being
the first character of the URL value. Additionally, a warning is also now issued for the previously
unsupported but available caret prefix. Removing the caret prefix and adding the path to the
`externalDependencies` build option should provide equivalent behavior.
2023-10-23 18:55:43 -04:00
Charles Lyding
5e47d82aa8 refactor(@angular-devkit/build-angular): show build time on failures with application builder
The build time is now shown when bundling fails. Previously only the errors were shown. This
provides additional information that the build did indeed fail and how long it took to fail.
2023-10-23 18:55:26 -04:00
Charles Lyding
0862a38441 refactor(@angular-devkit/build-angular): remove Sass module resolve workarounds
The recent version of the Sass compiler (`dart-sass@1.68.0`) now provides
additional information within an importer that allows more accurate resolution of node
modules packages without several existing workarounds. Previously, the Sass files needed
to be pre-processed to extract all `@import` and `@use` paths so that information regarding
the containing Sass file could be used to fully resolve the paths. The Sass compiler now
provides this information directly.
2023-10-23 18:55:13 -04:00
Charles Lyding
babe4674f8 perf(@angular-devkit/build-angular): conditionally add Angular compiler plugin to polyfills bundling
When using the esbuild-based builders (`application`/`browser-esbuild`), the Angular compiler plugin
is now only added to the polyfills bundler configuration if TypeScript files are found in the `polyfills`
build option. This is not the case for a default project. The Angular compiler plugin is used to provide
type-checking diagnostics for any TypeScript files present within the build. However, if there are no
TypeScript files to process, there is no need to use it for the polyfills processing.
2023-10-23 18:54:49 -04:00
Charles Lyding
7229a3d31d fix(@angular-devkit/build-angular): use component style load result caching information for file watching
When using the esbuild-based builders (`application`/`browser-esbuild`) in watch mode including `ng serve`,
component stylesheets that used Sass and imported other stylesheets were previously no properly tracked.
As a result, changes to the imported stylesheets would not invalidate the component and the rebuild would
not contain the updated styles. The files used by the Sass (and Less) stylesheet processing are now correctly
tracked in these cases.
2023-10-23 18:54:18 -04:00
Alan Agius
86eae25f24 docs(@angular-devkit/build-angular): update prendering options descriptions
This commit updates several option descriptions
2023-10-23 17:35:28 +02:00
Charles Lyding
eefc20dcba build: update Sass to v1.69.4 2023-10-23 15:18:32 +02:00
Alan Agius
f6b5eb3472 refactor(@angular-devkit/build-angular): remove unused imports
Remove several unused imports
2023-10-23 15:17:21 +02:00
Alan Agius
c07cbd5073 fix(@schematics/angular): do not add unnecessary dependency on @angular/ssr during migration
Prior to this change the Universal migration ran and added `@angular/ssr` even the workspace did not depend on `@nguniversal/` packages.

Closes #26083
2023-10-23 15:17:08 +02:00
Alan Agius
2c1c676245 fix(@angular/cli): remove the need to specify --migrate-only when --name is used during ng update
This commit updates the behaviour of `ng update --migrate-only` to remove the need for `--migrate-only` option to be specified. `--migrate-only` will be set internally.

Before
```
ng update @angular/cli --migrate-only --name=migration-name
```

Now
```
ng update @angular/cli --name=migration-name
```
2023-10-20 23:11:50 +02:00
Angular Robot
569e2462c5 build: update angular 2023-10-20 11:39:12 -07:00
Charles Lyding
5bf0a0797c refactor(@angular-devkit/build-angular): isolate typescript usage to compilation worker thread in application builder
To improve initialization type for the application builder, loading of the typescript package as been removed from the
main thread. The parallel TS/NG compilation will instead load typescript during its worker thread startup. The typescript
package is currently large and can take several hundred milliseconds to load.
2023-10-20 11:38:22 -07:00
Charles Lyding
6029c7580e refactor(@angular-devkit/build-angular): workaround for piscina worker destroy recreation
When destroying a `piscina` package worker pool, the minimum workers must be set to 0 first
to prevent the recreation of the minimum number of workers. These workers would then be
cleaned up once the worker pool goes out of scope but the recreation and initialization of
each worker is unneeded processing that should be avoided.
2023-10-20 11:38:09 -07:00
Charles Lyding
832146385b perf(@angular-devkit/build-angular): reuse esbuild generated output file hashes
The development server used with the esbuild-based builders (`application`/`browser-esbuild`) will
now use the recently introduced hash values provided by esbuild in its output files. This removes
the need for each file to be hashed and analyzed on each rebuild during the development server
update analysis.
2023-10-20 11:37:57 -07:00
Susheel Thapa
706483d1c5 docs: fix the typo in multiple files 2023-10-20 11:37:35 -07:00
Alan Agius
6f520a93ac perf(@angular-devkit/build-angular): cache polyfills virtual module result
This commit adds caching to the polyfills virtual modules to avoid module resolutions on rebuilds which can take up to 3 seconds in some cases. Whilst these are done async, these can still slow down the build slightly due to IO limits.
2023-10-20 16:06:00 +02:00
Alan Agius
886cb3167a fix(@angular-devkit/build-angular): resolve and load sourcemaps when using vite dev server with prerendering and ssr
This commit improves the printed error messages when using Vite with SSR and/or SSG by doing a couple of things.

- Enabling resolving and loading of sourcemap in Node.js by using `process.setSourceMapsEnabled`. See https://nodejs.org/api/process.html#processsetsourcemapsenabledval
- Amends Vite's `ssrTransform` method to remap the sourcemaps and inlines them.
- Enables `__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION` Zone.js flag to output cleaner stacktraces.

To enable, the above mentioned zone.js flag we had to create a server polyfill bundle as otherwise in some cases, zone.js would have been split and loaded before the flag.

**Before**
```
ERROR ReferenceError: window is not defined
    at new _AppComponent (/main.server.mjs:36:19)
    at NodeInjectorFactory.AppComponent_Factory [as factory] (/main.server.mjs:42:12)
    at getNodeInjectable (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:4277:44)
    at createRootComponent (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14399:35)
    at ComponentFactory.create (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14263:25)
    at ApplicationRef.bootstrap (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:31122:42)
    at file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:30644:32
    at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:368:26)
    at Object.onInvoke (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:11202:33)
    at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:367:52)
ERROR Error: Uncaught (in promise): ReferenceError: window is not defined
ReferenceError: window is not defined
    at new _AppComponent (/main.server.mjs:36:19)
    at NodeInjectorFactory.AppComponent_Factory [as factory] (/main.server.mjs:42:12)
    at getNodeInjectable (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:4277:44)
    at createRootComponent (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14399:35)
    at ComponentFactory.create (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14263:25)
    at ApplicationRef.bootstrap (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:31122:42)
    at file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:30644:32
    at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:368:26)
    at Object.onInvoke (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:11202:33)
    at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:367:52)
    at resolvePromise (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:1124:31)
    at /usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:1195:17
    at _ZoneDelegate.invokeTask (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:402:31)
    at AsyncStackTaggingZoneSpec.onInvokeTask (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:10879:28)
    at _ZoneDelegate.invokeTask (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:401:60)
    at Object.onInvokeTask (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:11189:33)
    at _ZoneDelegate.invokeTask (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:401:60)
    at Zone.runTask (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:173:47)
    at drainMicroTaskQueue (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:581:35) {
  rejection: ReferenceError: window is not defined
      at new _AppComponent (/main.server.mjs:36:19)
      at NodeInjectorFactory.AppComponent_Factory [as factory] (/main.server.mjs:42:12)
      at getNodeInjectable (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:4277:44)
      at createRootComponent (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14399:35)
      at ComponentFactory.create (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14263:25)
      at ApplicationRef.bootstrap (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:31122:42)
      at file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:30644:32
      at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:368:26)
      at Object.onInvoke (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:11202:33)
      at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:367:52),
  promise: ZoneAwarePromise [Promise] {
    __zone_symbol__state: 0,
    __zone_symbol__value: ReferenceError: window is not defined
        at new _AppComponent (/main.server.mjs:36:19)
        at NodeInjectorFactory.AppComponent_Factory [as factory] (/main.server.mjs:42:12)
        at getNodeInjectable (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:4277:44)
        at createRootComponent (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14399:35)
        at ComponentFactory.create (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14263:25)
        at ApplicationRef.bootstrap (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:31122:42)
        at file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:30644:32
        at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:368:26)
        at Object.onInvoke (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:11202:33)
        at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:367:52)
  },
  zone: <ref *1> Zone {
    _parent: Zone {
      _parent: [Zone],
      _name: 'asyncStackTagging for Angular',
      _properties: {},
      _zoneDelegate: [_ZoneDelegate]
    },
    _name: 'angular',
    _properties: { isAngularZone: true },
    _zoneDelegate: <ref *2> _ZoneDelegate {
      _taskCounts: [Object],
      zone: [Circular *1],
      _parentDelegate: [_ZoneDelegate],
      _forkZS: null,
      _forkDlgt: null,
      _forkCurrZone: null,
      _interceptZS: null,
      _interceptDlgt: null,
      _interceptCurrZone: null,
      _invokeZS: [Object],
      _invokeDlgt: [_ZoneDelegate],
      _invokeCurrZone: [Circular *1],
      _handleErrorZS: [Object],
      _handleErrorDlgt: [_ZoneDelegate],
      _handleErrorCurrZone: [Circular *1],
      _scheduleTaskZS: [Object],
      _scheduleTaskDlgt: [_ZoneDelegate],
8:23:50 AM [vite] Internal server error: window is not defined
      at new _AppComponent (/main.server.mjs:36:19)
      at NodeInjectorFactory.AppComponent_Factory [as factory] (/main.server.mjs:42:12)
      at getNodeInjectable (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:4277:44)
      at createRootComponent (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14399:35)
      at ComponentFactory.create (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:14263:25)
      at ApplicationRef.bootstrap (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:31122:42)
      at file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:30644:32
      at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:368:26)
      at Object.onInvoke (file:///usr/local/xxx/cli-reproduction/test-ssr-/node_modules/@angular/core/fesm2022/core.mjs:11202:33)
      at _ZoneDelegate.invoke (/usr/local/xxx/cli-reproduction/test-ssr-/node_modules/zone.js/fesm2015/zone-node.js:367:52)
```

**After**
```
ERROR ReferenceError: window is not defined
    at console (/src/app/app.component.ts:17:3)
    at NodeInjectorFactory.AppComponent_Factory (/src/app/app.component.ts:12:26)
    at getNodeInjectable (/usr/local/xxx/git/packages/core/src/render3/di.ts:659:38)
    at createRootComponent (/usr/local/xxx/git/packages/core/src/render3/component_ref.ts:464:31)
    at ComponentFactory.create (/usr/local/xxx/git/packages/core/src/render3/component_ref.ts:288:19)
    at ApplicationRef.bootstrap (/usr/local/xxx/git/packages/core/src/application_ref.ts:1017:38)
    at <anonymous> (/usr/local/xxx/git/packages/core/src/application_ref.ts:287:20)
    at _ZoneDelegate.invoke (/node_modules/zone.js/fesm2015/zone-node.js:370:40)
    at Object.onInvoke (/usr/local/xxx/git/packages/core/src/zone/ng_zone.ts:443:29)
    at _ZoneDelegate.invoke (/node_modules/zone.js/fesm2015/zone-node.js:370:40)
ERROR ReferenceError: window is not defined
    at console (/src/app/app.component.ts:17:3)
    at NodeInjectorFactory.AppComponent_Factory (/src/app/app.component.ts:12:26)
    at getNodeInjectable (/usr/local/xxx/git/packages/core/src/render3/di.ts:659:38)
    at createRootComponent (/usr/local/xxx/git/packages/core/src/render3/component_ref.ts:464:31)
    at ComponentFactory.create (/usr/local/xxx/git/packages/core/src/render3/component_ref.ts:288:19)
    at ApplicationRef.bootstrap (/usr/local/xxx/git/packages/core/src/application_ref.ts:1017:38)
    at <anonymous> (/usr/local/xxx/git/packages/core/src/application_ref.ts:287:20)
    at _ZoneDelegate.invoke (/node_modules/zone.js/fesm2015/zone-node.js:370:40)
    at Object.onInvoke (/usr/local/xxx/git/packages/core/src/zone/ng_zone.ts:443:29)
    at _ZoneDelegate.invoke (/node_modules/zone.js/fesm2015/zone-node.js:370:40)
8:13:37 AM [vite] Internal server error: window is not defined
      at console (/src/app/app.component.ts:17:3)
      at NodeInjectorFactory.AppComponent_Factory (/src/app/app.component.ts:12:26)
      at getNodeInjectable (/usr/local/xxx/git/packages/core/src/render3/di.ts:659:38)
      at createRootComponent (/usr/local/xxx/git/packages/core/src/render3/component_ref.ts:464:31)
      at ComponentFactory.create (/usr/local/xxx/git/packages/core/src/render3/component_ref.ts:288:19)
      at ApplicationRef.bootstrap (/usr/local/xxx/git/packages/core/src/application_ref.ts:1017:38)
      at <anonymous> (/usr/local/xxx/git/packages/core/src/application_ref.ts:287:20)
      at _ZoneDelegate.invoke (/node_modules/zone.js/fesm2015/zone-node.js:370:40)
      at Object.onInvoke (/usr/local/xxx/git/packages/core/src/zone/ng_zone.ts:443:29)
      at _ZoneDelegate.invoke (/node_modules/zone.js/fesm2015/zone-node.js:370:40)
```

**Note:** in the above case the error is printed 3x, this will be addressed in the future.
2023-10-20 15:12:12 +02:00
Alan Agius
84db78df65 refactor(@angular-devkit/build-angular): remove redundant prerendering content from vite devserver
In the devserver we do not perform ahead of time prerendering, instead we perform it during request time.
2023-10-20 14:34:14 +02:00