Cannot find module 'next/dist/next-server/lib/utils' or its corresponding type declarations.
See original GitHub issueDescribe the bug
I’m running into the same problem as this. https://github.com/vercel/next.js/issues/28319#issuecomment-902699740
This happens when I do a Next build.
- Version
- Next 11.1.0
- next-redux-wrapper 7.0.2
../node_modules/next-redux-wrapper/es6/index.d.ts:30:111
Type error: Cannot find module 'next/dist/next-server/lib/utils' or its corresponding type declarations.
28 | getServerSideProps: <P extends {} = any>(callback: GetServerSidePropsCallback<S, P>) => GetServerSideProps<P, import("querystring").ParsedUrlQuery>;
29 | getStaticProps: <P_1 extends {} = any>(callback: GetStaticPropsCallback<S, P_1>) => GetStaticProps<P_1, import("querystring").ParsedUrlQuery>;
> 30 | getInitialAppProps: <P_2 extends {} = any>(callback: AppCallback<S, P_2>) => ({ Component, ctx, }: import("next/dist/next-server/lib/utils").AppContextType<import("next/dist/client/router").Router>) => Promise<import("next/app").AppInitialProps>;
| ^
31 | getInitialPageProps: <P_3 extends {} = any>(callback: PageCallback<S, P_3>) => ((context: NextPageContext<any>) => any) | undefined;
32 | withRedux: (Component: NextComponentType | App | any) => {
33 | new (props: any, context: any): {
Nex.tjs answers.
You’ll have to report this to https://github.com/kirill-konshin/next-redux-wrapper as it’s using Next.js internals which can change at any time. Anything in next/dist should not be imported.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot find module 'next/dist/next-server/lib/utils' or ... - GitHub
ts:30:111 Type error: Cannot find module 'next/dist/next-server/lib/utils' or its corresponding type declarations. 28 | getServerSideProps: <P ...
Read more >Cannot find module 'next' or its corresponding type declarations
In Yarn 2/3, support for modules in the node_modules folder is removed because of PnP. Follow the steps below to resolve the issue....
Read more >Cannot find module 'X' Error in TypeScript | bobbyhadz
The "Cannot find module or its corresponding type declarations" error occurs when TypeScript cannot locate a third-party or local module in our project....
Read more >module-not-found - Next.js
A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies;...
Read more >next-optimized-images - Bountysource
Type error: Cannot find module '../public/images/socialImage.png' or its corresponding type declarations. 10 \| // Custom 11 \| import ".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released 7.0.3
This is what TypeScript is producing… I will try to fix it differently.