feat: block next/root-params imports in middleware and instrumentation layers
Add a webpack rule that errors when next/root-params is imported from middleware or instrumentation layers. Previously these imports would compile successfully with only a warning and the value would be undefined at runtime. Also switch the root-params rules from absolute path matching (resource) to regex matching (test) for reliability in isolated CI environments. On the Turbopack side, make the ServerContextType match exhaustive in the root-params mapper. Add Pages to the blocked list, improving an error where it fell through the wildcard and produced a misleading "Client Component" message instead of "App Directory".
Showing
Please
register
or
sign in
to comment