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

Missing REQUEST InjectionToken from @nguniversal/express-engine/tokens replacement package @angular/ssr #26331

Closed
maxfriedmann opened this issue Nov 11, 2023 · 4 comments

Comments

@maxfriedmann
Copy link

maxfriedmann commented Nov 11, 2023

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

@nguniversal/express-engine or @angular/ssr

Is this a regression?

No

Description

After the migration to Angular v17 (in an nx workspace) I am facing the error that the REQUEST InjectionToken cannot be found anymore. Since the @nguniversal/express-engine package got removed I can't find the InjectionToken in e.g. the @angular/ssr package.

How can I access the request object as described here? https://www.npmjs.com/package/@nguniversal/express-engine#using-the-request-and-response

image

Please provide a link to a minimal reproduction of the bug

https://www.npmjs.com/package/@nguniversal/express-engine#using-the-request-and-response

Please provide the exception or error you saw

See above

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

Angular CLI: 17.0.0
Node: 20.7.0
Package Manager: npm 10.1.0
OS: win32 x64

Angular: 17.0.2
... animations, common, compiler, compiler-cli, core, elements
... forms, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0 (cli-only)
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cdk                    17.0.0
@angular/cli                    17.0.0
@angular/google-maps            16.1.6
@angular/material               16.2.12
@angular/pwa                    16.2.5
@angular/ssr                    17.0.0
@ngtools/webpack                16.2.5
@schematics/angular             17.0.0
ng-packagr                      17.0.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else?

I migrated to angular via the Nx workspace migration tool (nx migrate latest & npx nx migrate --run-migrations --create-commits)

@JeanMeche JeanMeche transferred this issue from angular/angular Nov 11, 2023
@JeanMeche
Copy link
Member

Did you get any errors while running the migrations ? The schematics should handle that for you.
It creates a src/express.tokens.ts that contains the token definitions. Do you have it ? (See #26323 which is a closely related issue).

@JoostK
Copy link
Member

JoostK commented Nov 11, 2023

Nx implements the migrations themselves, and this particular one is present in Nx 17.1.

Since the tokens now have to be provided by user code and the CLI provides a migration to set this up, I am going to close this since Nx was used to update, not the CLI directly.

@JoostK JoostK closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2023
@maxfriedmann
Copy link
Author

You are right @JoostK, manually using the angular CLI works... With nx it will be tackled in nrwl/nx#20162

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants