Use app.useGlobalPipes(), app.useGlobalGuards(), app.useGlobalInterceptors(), and app.useGlobalFilters(). These bypass DI so they cannot inject services. To use DI, register globals inside a module using the APP_GUARD, APP_PIPE, APP_INTERCEPTOR, or APP_FILTER tokens.
app.useGlobal*() — simple but cannot inject services; use for dependency-free enhancers.
APP_* tokens — registered inside the DI container; supports full constructor injection.
The APP_* token approach is preferred for any enhancer that has dependencies.