You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Next.js启动/更新Redux状态时出现TypeError: Cannot set 'hook' of undefined

启动Next.js或更新Redux状态时反复出现TypeError: Cannot set properties of undefined (setting 'hook')错误

启动Next.js应用或更新Redux状态时,频繁遇到TypeError: Cannot set properties of undefined (setting 'hook')错误。这个错误并非每次状态更新都会触发,但会在应用运行过程中反复出现。

我遇到的问题和Stack Overflow上的同类提问情况类似,但自身package.json配置有所不同。已经尝试删除node_modules目录后重新安装依赖,问题仍未解决。

以下是我的package.json文件内容:

{
  "name": "abc-reactjs-boilerplate",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "concurrently \"next dev\" \"tailwindcss -i styles/globals.scss -o styles/dist.css -w\"",
    "build": "tailwindcss -m -i styles/globals.scss -o styles/dist.css && next build",
    "start": "next start",
    "lint": "prettier --check .",
    "setup": "node selectInstallation",
    "test": "jest",
    "test:ci": "jest --ci",
    "format": "prettier . --write"
  },
  "dependencies": {
    "@popperjs/core": "^2.11.6",
    "@tailwindcss/line-clamp": "^0.4.4",
    "@types/js-cookie": "^3.0.2",
    "@types/node": "18.11.9",
    "@types/react": "18.0.25",
    "@types/react-dom": "18.0.9",
    "antd": "^5.5.0",
    "axios": "^1.2.1",
    "dayjs": "^1.11.7",
    "eslint": "8.28.0",
    "eslint-config-next": "13.0.4",
    "formik": "^2.2.9",
    "jotai": "^1.11.1",
    "js-cookie": "^3.0.1",
    "next": "13.0.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-icons": "^4.8.0",
    "typescript": "4.9.3",
    "yup": "^1.1.1"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.4.3",
    "autoprefixer": "^10.4.14",
    "concurrently": "^7.6.0",
    "jest": "^29.5.0",
    "jest-environment-jsdom": "^29.5.0",
    "postcss": "^8.4.23",
    "sass": "^1.62.1",
    "tailwindcss": "^3.3.2"
  }
}

错误截图:
错误截图

内容的提问来源于stack exchange,提问作者Muhammad Farhan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 08:05:12