For route handlers, call `loadComponents` also during `next build` (#71202)
During `next dev` for route handlers, `loadComponents` is called to load the route module. This also has the (for now still expected) side-effect that the reference manifests singleton is set, which we need, to make `'use cache'` work in route handlers. Until now, `loadComponents` was not called during `next build` for route handlers, and the module was loaded separately with `RouteModuleLoader.load`. With this PR, we are aligning both modes, so that it's always ensured that the reference manifests singleton is set. The end goal is to avoid the global singleton completely, but it's still unclear how to achive this because of the requirements and constrains that are documented in #62437.
Showing
Please
register
or
sign in
to comment