Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Object prototype may only be an Object or null: undefined

未关闭
#109 7 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript, react
领域
security

调研方向

首先检查 node_modules/jws/lib/data-stream.js 和 sign-stream.js,然后使用列出的 React 18、react-scripts 和 jsonwebtoken 依赖重现报告的启动失败。将失败的浏览器 bundle 与软件包版本和迁移更改进行比较;当应用程序能够在没有 Object prototype 错误的情况下启动,且受影响的 jws 路径仍然正常工作时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

When migrating my app from react 17 to 18, got this in chrome when starting my app.

Uncaught runtime errors:
×
ERROR
Object prototype may only be an Object or null: undefined
TypeError: Object prototype may only be an Object or null: undefined
at Function.create ()
at Object.inherits (http://localhost:3010/static/js/bundle.js:62529:31)
at ./node_modules/jws/lib/data-stream.js (http://localhost:3010/static/js/bundle.js:66271:6)
at options.factory (http://localhost:3010/static/js/bundle.js:230212:31)
at webpack_require (http://localhost:3010/static/js/bundle.js:229657:33)
at fn (http://localhost:3010/static/js/bundle.js:229869:21)
at ./node_modules/jws/lib/sign-stream.js (http://localhost:3010/static/js/bundle.js:66295:18)
at options.factory (http://localhost:3010/static/js/bundle.js:230212:31)
at webpack_require (http://localhost:3010/static/js/bundle.js:229657:33)
at fn (http://localhost:3010/static/js/bundle.js:229869:21)

There're plenty of changes i made to migrate to react 18, so not very sure which one caused the issue. I'll update more info if i find out more, but this is the most of the package.json (except our internal libs). Any help appreciated.

  "scripts": {
    "start": "chmod +x ./env.sh && ./env.sh && mv env-config.js ./public/ && PORT=3010 react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "CI=true react-app-rewired test --reporters=default --reporters=jest-junit --testResultsProcessor=jest-sonar-reporter",
    "test:watch": "react-app-rewired test",
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "lint-staged": {
    "*.{html,js,json,jsx,md,sass,scss,yaml,yml}": [
      "npx prettier --write ."
    ],
    "*.{js,jsx}": [
      "npx eslint --fix ."
    ]
  },
  "dependencies": {
    "framer-motion": "10.16.2",
    "jsonwebtoken": "9.0.2",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.43",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-router-dom": "6.15.0",
    "react-scripts": "5.0.1",
    "react-toastify": "8.2.0",
    "sass": "1.66.1",
    "web-vitals": "3.4.0"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "6.1.2",
    "@testing-library/react": "14.0.0",
    "@testing-library/user-event": "14.4.3",
    "buffer": "^6.0.3",
    "husky": "8.0.3",
    "jest-junit": "16.0.0",
    "jest-sonar-reporter": "2.0.0",
    "lint-staged": "14.0.1",
    "prettier": "3.0.3",
    "process": "^0.11.10",
    "react-app-rewired": "^2.2.1",
    "util": "^0.12.5"
  }
}
主要语言
JavaScript
星标
720
派生
136
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

auth0/node-jws 的其他 Issue

查看 auth0/node-jws 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。