Skip to content

Conversation

@9kubczas4
Copy link
Contributor

Description

There was a following change in main server file template in Angular 17:

// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = mainModule && mainModule.filename || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
  run();
}

to

run();

The guard to call run function was removed. In the result, there is an issue when someone tries to deploy Angular 17+ app with SSR.

The solution fixes: #6651.

Scenarios Tested

Angular 17+:

  • server.ts has got run call and SSR is enabled in angular.json - deployment was successful and SSR pages works (without fix SSR pages were failing)

Sample Commands

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 53.07%. Comparing base (8f34600) to head (b711387).
Report is 11 commits behind head on master.

Files Patch % Lines
src/frameworks/angular/index.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7556   +/-   ##
=======================================
  Coverage   53.06%   53.07%           
=======================================
  Files         391      391           
  Lines       27003    27015   +12     
  Branches     5571     5579    +8     
=======================================
+ Hits        14330    14339    +9     
- Misses      11393    11395    +2     
- Partials     1280     1281    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@9kubczas4 9kubczas4 enabled auto-merge (squash) September 12, 2024 07:00
@9kubczas4 9kubczas4 merged commit 5bb5d12 into master Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular SSR 17 in Firebase : listen EADDRINUSE: address already in use :::8080

3 participants