Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update package.json - add types to exports
when changing moduleResolution from node to bundler (as in https://github.com/vercel/next.js/pull/51957/files#diff-066cacecd32e0ca72d47360ddb35c19a676835816eed05163e05564ec0874590)in tsconfig.json following errors occurs: ./pages/sitemap.xml/index.tsx:2:36 Type error: Could not find a declaration file for module 'next-sitemap'. 'C:/dev/frontend/project/node_modules/next-sitemap/dist/esm/index.js' implicitly has an 'any' type. There are types at 'C:/dev/frontend/project/node_modules/next-sitemap/dist/@types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'next-sitemap' library may need to update its package.json or typings. 1 | import type { GetServerSideProps } from "next"; > 2 | import type { ISitemapField } from "next-sitemap"; The error can be fixed via copying the types to the exports "." section in package.json (as described here: https://stackoverflow.com/a/76212193/1548552)
- Loading branch information