Replies: 1 comment
-
Note that the workaround proposed in the thread does not work either: import * as __SELF__ from './page';
__SELF__ satisfies { privateData: PrivateData, metadata: Metadata }; Works to do a check (the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Allow pages to return custom named exports in a well typed manner
Alternatively, at least not trigger an error
Non-Goals
No response
Background
Currently, trying to export a custom named export when using the workspace typescript triggers an error:
Using a comment directive doesn't work:
There seems to be no way to not get errors, which forces me to revert to my default typescript version. Then, my custom export is valid, but I need to explicitly type
metadata
and lose on the Next-specific checks.Proposal
I suggest to either:
//@ts-ignore
or others work with the code located atpackages/next/src/server/typescript/rules/config.ts
next.config.js
I have no idea how extending Typescript works and if either suggestion is even possible at all, so I'm not sure if what I'm proposing is sound.
Beta Was this translation helpful? Give feedback.
All reactions