I'm using Next.js 14.0.3 App Router and Sanity.io v3. I'm getting the error shown in the image below. I'm connecting to Sanity.io using the "next-sanity" package in Nextjs. I think there is a problem with the "language-filter" of next-sanity. Can you help me please?
Screenshots:
These are sanity versions:
@sanity/cli (global) 3.20.1 (up to date)
@sanity/cli 3.20.1 (up to date)
@sanity/color 2.2.5 (up to date)
@sanity/dashboard 3.1.5 (up to date)
@sanity/document-internationalization 2.0.2 (up to date)
@sanity/icons 2.7.0 (up to date)
@sanity/image-url 1.0.2 (up to date)
@sanity/language-filter 3.2.1 (up to date)
@sanity/preview-kit 4.0.1 (up to date)
@sanity/types 3.20.1 (up to date)
@sanity/ui 1.9.3 (up to date)
@sanity/vision 3.20.1 (up to date)
sanity 3.20.1 (up to date)
What operating system are you using?
macOS
Which versions of Node.js / npm are you running? npm -v && node -v
npm: 9.8.1
node: v18.18.2
Additional context:
// /sanity/client.ts
import { deskTool } from "sanity/desk";
import { visionTool } from "@sanity/vision";
import { PluginOptions, defineConfig } from "sanity";
import { languageFilter } from '@sanity/language-filter'
import { langs } from "@/encoded-url";
import { ApiIcon } from "@sanity/icons";
import { NEXT_PUBLIC_SANITY_DATASET_PRODUCTION, NEXT_PUBLIC_SANITY_DATASET_STAGING, NEXT_PUBLIC_SANITY_PROJECT_ID } from "@/utils/constants";
import { PAGES_NAME } from "@/sanity/schemas/constants";
import { i18nConfig } from "@/i18nConfig";
// Sanity plugins
import { settings, pages } from "@/sanity/plugins";
// Sanity schemas
import { schema } from "@/sanity/schemas";
const plugins: PluginOptions[] = [
languageFilter({
documentTypes: [PAGES_NAME], // <-- hangi sayfalar çevrilecek?
defaultLanguages: [i18nConfig.defaultLocale],
supportedLanguages: langs.map(m => ({ id: m.code, title: `${m.title} (${m.originalTitle})` })),
filterField: (enclosingType, field, selectedLanguageIds) => !enclosingType.name.startsWith("locale") || selectedLanguageIds.includes(field.name),
}),
deskTool(pages),
deskTool(settings),
];
export default defineConfig([
// other configs and admin...
{
name: "admin",
basePath: "/admin",
projectId: NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: NEXT_PUBLIC_SANITY_DATASET_PRODUCTION,
schema,
plugins: [
...plugins,
visionTool({
name: "groq-query",
title: "Vision",
icon: ApiIcon,
}),
],
}
]);
Error: "The page tool crashed"
I'm using Next.js 14.0.3 App Router and Sanity.io v3. I'm getting the error shown in the image below. I'm connecting to Sanity.io using the "next-sanity" package in Nextjs. I think there is a problem with the "language-filter" of next-sanity. Can you help me please?
Screenshots:
These are
sanity versions
:What operating system are you using?
Which versions of Node.js / npm are you running?
npm -v && node -v
npm: 9.8.1 node: v18.18.2
Additional context: