next-dev.js:20 TypeError: Cannot set properties of undefined (setting ‘hook’)

huangapple go评论64阅读模式
英文:

next-dev.js:20 TypeError: Cannot set properties of undefined (setting 'hook'),

问题

这个错误在启动应用程序时或者只是在更新 Redux 状态时会出现,有时它不会在一些状态更新中显示,但出现在整个应用程序中的某些原因。

next-dev.js:20 TypeError: Cannot set properties of undefined (setting 'hook')

我遇到了与 https://stackoverflow.com/questions/73129969/next-js-typeerror-cannot-set-properties-of-undefined-setting-hook 中提到的相同问题,但我的 package.json 文件不同。以下是我的 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"
  }
}

删除 node_modules 但没有起作用。错误截图:next-dev.js:20 TypeError: Cannot set properties of undefined (setting ‘hook’)

英文:

his error just "explodes" when starting the app or just update the redux state sometimes it do not shows for few state updates, but for some reason it appears all along the app

next-dev.js:20 TypeError: Cannot set properties of undefined (setting 'hook'),

I have the same issues as mentioned in https://stackoverflow.com/questions/73129969/next-js-typeerror-cannot-set-properties-of-undefined-setting-hook

but my package.json file is different.

below is my package.json file

{
  "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"
  }
}

Removing node_modules but didn't worked

Error screenshot:
next-dev.js:20 TypeError: Cannot set properties of undefined (setting ‘hook’)

答案1

得分: -1

这个错误是由一些恶意的Chrome扩展程序引起的,我已经使用了访客Chrome浏览器,错误不再出现。

英文:

This error was due to the some malicious chrome extension, i have used the guest chrome browser and the errors are gone.

huangapple
  • 本文由 发表于 2023年5月22日 22:12:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76307091.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定