Problem/Motivation
After upgrading from Drupal 9 to 10, JS scripts are not working. This is due to the following error:
```
TypeError: Drupal\Core\Asset\JsCollectionOptimizerLazy::optimizeGroup(): Return value must be of type string, null returned in Drupal\Core\Asset\JsCollectionOptimizerLazy->optimizeGroup() (line 185 of core/lib/Drupal/Core/Asset/JsCollectionOptimizerLazy.php).
Drupal\system\Controller\AssetControllerBase->deliver(Object, 'js__rpfGUkboRUBAZE_KH_2GRWjPWshR9E-CfkBDtLMm1g.js')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```
It seems there is a "cleaning" process that ends up returning NULL instead of the actual contents of the aggregated file.
Commenting out this line at https://github.com/drupal/drupal/blob/10.1.6/core/lib/Drupal/Core/Asset/... and just returning $data "resolves" the issue.
I'm not sure why the clean method is removing everything as it seems it should only remove source mapping URLs if I'm understanding the purpose correctly.
To my knowledge, the JS files should be compatible with Drupal 10 as the primary update of switching to the `once()` function has been made.
Unfortunately, I have not seen this issue on other projects and other similar issues posted that I've seen do not seem to stem from the same error.
Steps to reproduce
This issue occurs when JS aggregation is enabled.
Visiting any page where the JS is leveraged, and the aggregated file is needed, will trigger the issue.