Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'replace' of undefined #136

Closed
jason-adnuntius opened this issue Dec 22, 2021 · 1 comment
Closed

TypeError: Cannot read property 'replace' of undefined #136

jason-adnuntius opened this issue Dec 22, 2021 · 1 comment

Comments

@jason-adnuntius
Copy link

I am getting the following error when trying to generate the report after a test run. I get this issue only if I enable includeFailureMsg: true

(node:403338) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'replace' of undefined
    at S.sanitizeOutput (/mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:11287)
    at /mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:6668
    at Array.forEach (<anonymous>)
    at /mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:6617
    at Array.forEach (<anonymous>)
    at /mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:6090
    at Array.map (<anonymous>)
    at S.renderTestReportContent (/mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:5741)
    at S.renderTestReport (/mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:1926)
    at S.generate (/mnt/data/pellcorp/Development/browser-test/node_modules/jest-html-reporter/dist/index.js:1:1504)

My reporters config:

reporters: [
    "default",
    ["./node_modules/jest-html-reporter", {
      "outputPath": "build-output/test-report.html",
      "includeFailureMsg": true,
      "includeConsoleLog": true,
      "append": false,
      "sort": "status"
    }]
  ]

My npm list:

$ npm list --depth=1
browser-test@1.0.0 /mnt/data/pellcorp/Development/browser-test
├─┬ axios@0.21.4
│ └── follow-redirects@1.14.6
├── dateformat@4.6.3
├── dotenv@10.0.0
├─┬ eslint@7.32.0
│ ├── @babel/code-frame@7.12.11
│ ├── @eslint/eslintrc@0.4.3
│ ├── @humanwhocodes/config-array@0.5.0
│ ├── ajv@6.12.6
│ ├── chalk@4.1.2
│ ├── cross-spawn@7.0.3
│ ├── debug@4.3.3
│ ├── doctrine@3.0.0
│ ├── enquirer@2.3.6
│ ├── escape-string-regexp@4.0.0
│ ├── eslint-scope@5.1.1
│ ├── eslint-utils@2.1.0
│ ├── eslint-visitor-keys@2.1.0
│ ├── espree@7.3.1
│ ├── esquery@1.4.0
│ ├── esutils@2.0.3
│ ├── fast-deep-equal@3.1.3
│ ├── file-entry-cache@6.0.1
│ ├── functional-red-black-tree@1.0.1
│ ├── glob-parent@5.1.2
│ ├── globals@13.12.0
│ ├── ignore@4.0.6
│ ├── import-fresh@3.3.0
│ ├── imurmurhash@0.1.4
│ ├── is-glob@4.0.3
│ ├── js-yaml@3.14.1
│ ├── json-stable-stringify-without-jsonify@1.0.1
│ ├── levn@0.4.1
│ ├── lodash.merge@4.6.2
│ ├── minimatch@3.0.4
│ ├── natural-compare@1.4.0
│ ├── optionator@0.9.1
│ ├── progress@2.0.3
│ ├── regexpp@3.2.0
│ ├── semver@7.3.5
│ ├── strip-ansi@6.0.1
│ ├── strip-json-comments@3.1.1
│ ├── table@6.7.5
│ ├── text-table@0.2.0
│ └── v8-compile-cache@2.3.0
├─┬ isomorphic-fetch@3.0.0
│ ├── node-fetch@2.6.6
│ └── whatwg-fetch@3.6.2
├─┬ jest-circus@27.4.5
│ ├── @jest/environment@27.4.4
│ ├── @jest/test-result@27.4.2
│ ├── @jest/types@27.4.2
│ ├── @types/node@17.0.2
│ ├── chalk@4.1.2 deduped
│ ├── co@4.6.0
│ ├── dedent@0.7.0
│ ├── expect@27.4.2
│ ├── is-generator-fn@2.1.0
│ ├── jest-each@27.4.2
│ ├── jest-matcher-utils@27.4.2
│ ├── jest-message-util@27.4.2
│ ├── jest-runtime@27.4.5
│ ├── jest-snapshot@27.4.5
│ ├── jest-util@27.4.2
│ ├── pretty-format@27.4.2
│ ├── slash@3.0.0
│ ├── stack-utils@2.0.5
│ └── throat@6.0.1
├─┬ jest-html-reporter@3.4.2
│ ├── @babel/core@7.16.5
│ ├── @babel/preset-env@7.16.5
│ ├── @babel/preset-typescript@7.16.5
│ ├── @jest/console@25.5.0
│ ├── @jest/test-result@25.5.0
│ ├── @jest/types@26.6.2
│ ├── @types/dateformat@3.0.1
│ ├── @types/jest@25.2.3
│ ├── @types/mkdirp@1.0.2
│ ├── @types/node@12.20.38
│ ├── @types/sinon@7.5.2
│ ├── dateformat@3.0.2
│ ├── jest@27.4.5 deduped
│ ├── mkdirp@1.0.4
│ ├── sinon@9.2.4
│ ├── strip-ansi@6.0.1 deduped
│ └── xmlbuilder@15.0.0
├─┬ jest-puppeteer@5.0.4
│ ├── expect-puppeteer@5.0.4
│ ├── jest-environment-puppeteer@5.0.4
│ └── puppeteer@9.1.1 deduped
├─┬ jest-runner-eslint@0.10.1
│ ├── chalk@3.0.0
│ ├── cosmiconfig@6.0.0
│ ├── create-jest-runner@0.6.0
│ ├── eslint@7.32.0 deduped
│ └── jest@27.4.5 deduped
├─┬ jest@27.4.5
│ ├── @jest/core@27.4.5
│ ├── import-local@3.0.3
│ ├── jest-cli@27.4.5
│ └── UNMET OPTIONAL DEPENDENCY node-notifier@^8.0.1 || ^9.0.0 || ^10.0.0
├── lodash@4.17.21
├─┬ puppeteer@9.1.1
│ ├── debug@4.3.3 deduped
│ ├── devtools-protocol@0.0.869402
│ ├── extract-zip@2.0.1
│ ├── https-proxy-agent@5.0.0
│ ├── node-fetch@2.6.6 deduped
│ ├── pkg-dir@4.2.0
│ ├── progress@2.0.3 deduped
│ ├── proxy-from-env@1.1.0
│ ├── rimraf@3.0.2
│ ├── tar-fs@2.1.1
│ ├── unbzip2-stream@1.4.3
│ └── ws@7.5.6
└─┬ query-string@7.0.1
  ├── decode-uri-component@0.2.0
  ├── filter-obj@1.1.0
  ├── split-on-first@1.1.0
  └── strict-uri-encode@2.0.0

If I am have made an obviously stupid mistake, feel free to ridicule me as any solution is a good solution!

I am not a javascript developer, im just the devops guy trying to fix the build

@jason-adnuntius
Copy link
Author

Hi,

Never mind, I think I must have had a weird package-lock.json, its all working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant