Recently, I encountered an issue with my Next.js blog using next-sanity. After updating all npm packages, I found that running npm run build
resulted in a type error within one of the dependencies:
./node_modules/@sanity/types/lib/dts/src/index.d.ts:756:3
Type error: Type parameter declaration expected.
754 | */
755 | export declare function defineArrayMember<
> 756 | const TType extends string | IntrinsicTypeName, // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
| ^
757 | const TName extends string,
758 | TSelect extends Record<string, string> | undefined,
759 | TPrepareValue extends Record<keyof TSelect, any> | undefined,
I have attempted to manually add older versions of the problematic package without success. Even deleting node_modules and package.json then running npm i
again did not resolve the issue.
Has anyone else experienced this same problem?
After running npm update
, I addressed some changes mentioned in the documentation. However, essential features that were previously functioning are now failing despite no apparent errors in the documentation indicating that a mistake was made.
My current versions are next 14.1.0
, next-sanity 8.5.0
, and sanity 3.36.2