我不知道如何解决问题是(TypeError:无法读取未定义的属性(阅读“调用”))基本上我不知道它在控制台中的位置,我没有线程,只有在错误页面上
这是我的应用程序的外观
- 应用程序/工作室/...索引/页面.tsx*
'use client'
import {NextStudio} from 'next-sanity/studio'
import config from '../../../sanity.config'
export default function StudioPage() {
// Supports the same props as `import {Studio} from 'sanity'`, `config` is required
return <NextStudio config={config} />
}
- 应用程序/工作室/...索引/head.tsx*
export {NextStudioHead} from 'next-sanity/studio/head'
import {NextStudioHead} from 'next-sanity/studio/head'
export default function CustomStudioHead() {
return (
<>
<NextStudioHead favicons={false} />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="https://www.sanity.io/static/images/favicons/favicon-32x32.png"
/>
</>
)
}
- 应用程序/工作室/...索引/head.tsx*
'use client'
import config from '../../../sanity.config'
import NextStudioLoading from 'next-sanity/studio/loading'
export default function Loading() {
return <NextStudioLoading config={config} />
}
- 下一个配置js*
module.exports = {
reactStrictMode: true,
experimental:{
appDir: true
}
}
- 健全.临床.ts*
import {defineCliConfig} from 'sanity/cli'
export default defineCliConfig({
api: {
projectId: process.env.NEXT_PROJECT_ID,
dataset: 'production'
}
})
- 健全配置ts*
import {defineCliConfig} from 'sanity/cli'
export default defineCliConfig({
api: {
projectId: process.env.NEXT_PROJECT_ID,
dataset: 'production'
}
})
- 包.json*
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@portabletext/react": "^2.0.0",
"@sanity/image-url": "^1.0.1",
"next": "latest",
"next-sanity": "^3.1.3",
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"@sanity/vision": "^3.0.0",
"sanity": "^3.0.0",
"styled-components": "^5.2.0"
},
"devDependencies": {
"@sanity/eslint-config-studio": "^2.0.1",
"@types/node": "18.11.3",
"@types/react": "18.0.21",
"@types/react-dom": "18.0.6",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.18",
"tailwindcss": "^3.2.1",
"typescript": "4.8.4"
}
}
1条答案
按热度按时间vxqlmq5t1#
我遇到了同样的错误,并通过安装next 13“npm i next@13.0.8-canary.2”的金丝雀版本来解决它