With Angular 17, Request & Response tokens are not available anymore directly from angular. Spartacus 2211.19.0 offers those DI Tokens to import and use them.
This works perfectly while using them in the server.ts
which get’s compiled to run in a node environment.
When using the Injection Tokens within the application code (e.g. to change the response http status code or add additional response header flags), it breaks the build, since the import from @spartacus/setup
also imports code, which does not run in browsers and therefore also does not compile:
Please move the DI Tokens to another Package, which does not contain node packages like path
, fs
and so on..