NodeJS Next.js和Sanity V3 Studio未处理的运行时错误:TypeError:无法读取未定义的属性(阅读“call”)

jhkqcmku  于 2022-12-22  发布在  Node.js
关注(0)|答案(1)|浏览(110)

我尝试使用Sanity V3和Next.js 13来创建博客文章,但是当我转到/studio时发生了错误

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'call')

Call Stack
options.factory
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/webpack.js (722:31)
__webpack_require__
/_next/static/chunks/webpack.js (37:33)
fn
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/webpack.js (377:21)
eval
node_modules\next\dist\compiled\react\cjs\react-jsx-dev-runtime.development.js (17:12)
eval
node_modules\next\dist\compiled\react\cjs\react-jsx-dev-runtime.development.js (1328:3)
./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/app/studio/[[...index]]/page.js (5088:1)
options.factory
/_next/static/chunks/webpack.js (722:31)
__webpack_require__
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (377:21)
eval
node_modules\next\dist\compiled\react\jsx-dev-runtime.js (6:2)
./node_modules/next/dist/compiled/react/jsx-dev-runtime.js
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/app/studio/[[...index]]/page.js (5110:1)
options.factory
/_next/static/chunks/webpack.js (722:31)
__webpack_require__
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (377:21)
eval
webpack-internal:///./app/studio/[[...index]]/page.tsx (5:79)
./app/studio/[[...index]]/page.tsx
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/app/studio/[[...index]]/page.js (4991:1)
options.factory
/_next/static/chunks/webpack.js (722:31)
__webpack_require__
file:///C:/Users/nechy/Desktop/All%20at%20Once/all_at_once_blog/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (377:21)
__webpack_require__
node_modules\next\dist\client\app-index.js (26:16)
eval
node_modules\next\dist\compiled\react-server-dom-webpack\client.js (106:0)

软件包. 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",
    "@sanity/vision": "^3.0.0",
    "next": "latest",
    "next-sanity": "^3.1.3",
    "react": "18.2.0",
    "react-dom": "18.2.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"
  }
}

我使用了下一个sanity的npm包,以迁移Sanity文件夹和下一个js文件夹在一个。似乎有些东西是错误的webpack,我只是不知道到底是什么。将非常感谢帮助。谢谢

dm7nw8vv

dm7nw8vv1#

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

相关问题