Fix stale userland config in AppRouteRouteModule after server HMR
With server HMR enabled, AppRouteRouteModule was already re-fetching
the live userland module for the actual handler function via
_getUserland(), but three routing-critical properties (fetchCache,
dynamic, and hasNonStaticMethods) were still read from this.userland —
the static module snapshot captured at cold-boot that is never refreshed
by HMR.
This meant that adding or removing exports like `dynamic = 'force-static'`
or introducing POST/PUT/DELETE handlers required a full server restart
to take effect, even though the handler function body itself updated
correctly.
Fix: resolve the live userland once per request via _getUserland() and
use that single resolved module for all reads in handle(), including
the handler function resolution. Remove the now-redundant
resolveWithGetter() helper.
Co-Authored-By:
Claude <noreply@anthropic.com>
Showing
Please
register
or
sign in
to comment