next.js
9d150b11 - Loose RSC import restrictions for 3rd party packages (#56501)

Commit
2 years ago
Loose RSC import restrictions for 3rd party packages (#56501) When we landed #51179 it broke library like `apollo-client` as it's bundling client hooks into RSC bundle, so our RSC linter caught them and reported fatal errors. But those client hook APIs won't get executed in RSC. The original purpose of erroring on invalid hooks for server & client components was to catch bugs easier, but it might be too strict for the 3rd party libraries like `apollo-client` due to few reasons. We changed the rules only applying on user land source code. For 3rd party packages if they're not being imported correctly into proper server or client components, we're still showing runtime errors instead of fatal build errors. x-ref: https://github.com/apollographql/apollo-client/issues/10974 Closes NEXT-1673
Author
Parents
Loading