'PagesPageConfig' is declared but never used. #82704
-
You're declaring this type for " legacy Pages Router pages" but you're declaring it also on app router starting from the latest few cnaries, this will throw a typescript error because the type is unused and I have typescript configs that check for unused variables. "next": "15.4.2-canary.50", It wasn't happening for sure in canary.44. type PagesPageConfig = {
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Hi @Pnlvfx In the latest Next.js canary releases (15.4.2-canary.50 and above), a TypeScript type for legacy Pages Router pages is also being declared for the App Router. This causes issues because:
Previously, this didn’t happen in canary.44, so it’s a recent change. If you’re using strict TypeScript settings (like Workaround:
References: |
Beta Was this translation helpful? Give feedback.
-
I’m experiencing the same issue on canary.50 — PagesPageConfig is flagged as unused by TypeScript when using strict unused checks. It seems this type is no longer referenced internally, so either it should be conditionally exported only for Pages Router, or removed entirely in App Router builds to avoid breaking stricter TS configs. This didn’t happen in canary.44, so likely a recent regression. |
Beta Was this translation helpful? Give feedback.
-
How can I try to reproduce this issue? A simple create-next-app with canaries doesn't do it. I have some idea on what problem could be happening, but I'd like to be able to replicate the issue. |
Beta Was this translation helpful? Give feedback.
And a fix was merged! #82755