next.js TypeError:无法读取未定义的属性(阅读“call”),健全性错误

wfypjpf4  于 2022-12-23  发布在  其他
关注(0)|答案(1)|浏览(139)

我不知道如何解决问题是(TypeError:无法读取未定义的属性(阅读“调用”))基本上我不知道它在控制台中的位置,我没有线程,只有在错误页面上

这是我的应用程序的外观

'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} />
}
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"
      />
    </>
  )
}
'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"
  }
}
vxqlmq5t

vxqlmq5t1#

我遇到了同样的错误,并通过安装next 13“npm i next@13.0.8-canary.2”的金丝雀版本来解决它

相关问题