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 'newIndex' of undefined #1657

Closed
rajasegar opened this issue Oct 12, 2020 · 8 comments
Closed

TypeError: Cannot read property 'newIndex' of undefined #1657

rajasegar opened this issue Oct 12, 2020 · 8 comments
Labels

Comments

@rajasegar
Copy link

Current behavior

Semantic release fails in Github Actions with the above error message

Expected behavior

Release should be done propoer

Environment

Run yarn install
yarn install v1.22.5
info No lockfile found.
[1/4] Resolving packages...
warning libnpm > npm-lifecycle > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning libnpm > npm-lifecycle > node-gyp > request > har-validator@5.1.5: this library is no longer supported
warning semantic-release > @semantic-release/npm > npm > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 32.08s.
yarn run v1.22.5
$ /home/runner/work/npmx/npmx/node_modules/.bin/semantic-release
[5:26:40 AM] [semantic-release] › ℹ  Running semantic-release version 17.2.0
[5:26:41 AM] [semantic-release] › ✖  An error occurred while running semantic-release: TypeError: Cannot read property 'newIndex' of undefined
    at extractPropertyKeysOfObject (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:87:34)
    at extractPropertyKeysOfObject (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:65:39)
    at extractAllPropertyKeysOfContent (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:45:14)
    at checkRedundancy (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:28:27)
    at _default (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:15:14)
    at pkgRepoUrl (/home/runner/work/npmx/npmx/node_modules/semantic-release/lib/get-config.js:103:18)
    at async module.exports (/home/runner/work/npmx/npmx/node_modules/semantic-release/lib/get-config.js:80:21)
    at async module.exports (/home/runner/work/npmx/npmx/node_modules/semantic-release/index.js:257:32)
    at async module.exports (/home/runner/work/npmx/npmx/node_modules/semantic-release/cli.js:55:5)
TypeError: Cannot read property 'newIndex' of undefined
    at extractPropertyKeysOfObject (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:87:34)
    at extractPropertyKeysOfObject (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:65:39)
    at extractAllPropertyKeysOfContent (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:45:14)
    at checkRedundancy (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:28:27)
    at _default (/home/runner/work/npmx/npmx/node_modules/find-duplicated-property-keys/build/index.js:15:14)
    at pkgRepoUrl (/home/runner/work/npmx/npmx/node_modules/semantic-release/lib/get-config.js:103:18)
    at async module.exports (/home/runner/work/npmx/npmx/node_modules/semantic-release/lib/get-config.js:80:21)
    at async module.exports (/home/runner/work/npmx/npmx/node_modules/semantic-release/index.js:257:32)
    at async module.exports (/home/runner/work/npmx/npmx/node_modules/semantic-release/cli.js:55:5)error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
@MichaelAicher
Copy link

We're experiencing the same issue on Gitlab.

[OK]Using Docker executor with image node:10 ...
[OK]Pulling docker image node:10 ...
[OK]Using docker image sha256:a8441ebf4e4da3557acec63c3b9b87f0a3e11b16811f7991a292e108ddb21053 for node:10 ...
(...)
$ npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/gitlab -p @semantic-release/gitlab-config -p semantic-release semantic-release
npx: Installed 1488 in 27.663s
[8:05:44 AM] [semantic-release]  › ℹ  Running semantic-release version 17.2.0
[8:05:44 AM] [semantic-release]  › ✖  An error occurred while running semantic-release: TypeError: Cannot read property 'newIndex' of undefined
    at extractPropertyKeysOfObject (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:87:34)
    at extractPropertyKeysOfObject (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:65:39)
    at extractAllPropertyKeysOfContent (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:45:14)
    at checkRedundancy (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:28:27)
    at _default (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:15:14)
    at pkgRepoUrl (/root/.npm/_npx/15/lib/node_modules/semantic-release/lib/get-config.js:103:18)
TypeError: Cannot read property 'newIndex' of undefined
    at extractPropertyKeysOfObject (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:87:34)
    at extractPropertyKeysOfObject (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:65:39)
    at extractAllPropertyKeysOfContent (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:45:14)
    at checkRedundancy (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:28:27)
    at _default (/root/.npm/_npx/15/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:15:14)
    at pkgRepoUrl (/root/.npm/_npx/15/lib/node_modules/semantic-release/lib/get-config.js:103:18)section_end:1602489946:build_script

@PeterMerkert
Copy link

Same on CircleCI:

npx: installed 770 in 12.481s
[5:43:30 AM] [semantic-release] › ℹ  Running semantic-release version 17.2.0
[5:43:30 AM] [semantic-release] › ✖  An error occurred while running semantic-release: TypeError: Cannot read property 'newIndex' of undefined
    at extractPropertyKeysOfObject (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:87:34)
    at extractPropertyKeysOfObject (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:65:39)
    at extractAllPropertyKeysOfContent (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:45:14)
    at checkRedundancy (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:28:27)
    at _default (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:15:14)
    at pkgRepoUrl (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/lib/get-config.js:103:18)
    at async module.exports (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/lib/get-config.js:80:21)
    at async module.exports (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/index.js:257:32)
    at async module.exports (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/cli.js:55:5)
TypeError: Cannot read property 'newIndex' of undefined
    at extractPropertyKeysOfObject (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:87:34)
    at extractPropertyKeysOfObject (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:65:39)
    at extractAllPropertyKeysOfContent (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:45:14)
    at checkRedundancy (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:28:27)
    at _default (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/node_modules/find-duplicated-property-keys/build/index.js:15:14)
    at pkgRepoUrl (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/lib/get-config.js:103:18)
    at async module.exports (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/lib/get-config.js:80:21)
    at async module.exports (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/index.js:257:32)
    at async module.exports (/home/circleci/.npm/_npx/121/lib/node_modules/semantic-release/cli.js:55:5)

@yevhenlisovenko
Copy link

yevhenlisovenko commented Oct 12, 2020

Confirm the issue in 17.2.0. Waiting the fix!

Updated:
as a temporary solution we have fixed the version in deploy
npx semantic-release@17.1.2

@travi travi closed this as completed in 3abcbaf Oct 12, 2020
@travi
Copy link
Member

travi commented Oct 12, 2020

I've reverted the change that introduced this issue. a new version that includes the revert should publish soon

@semantic-release-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 17.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gr2m
Copy link
Member

gr2m commented Oct 12, 2020

We introduced the new find-duplicated-property-keys dependency in 17.2.0, as part of #1656. All tests passed, but looks like we missed something. Sorry for the trouble!

@gr2m
Copy link
Member

gr2m commented Oct 12, 2020

Here is a minimal test case to reproduce the problem: https://runkit.com/gr2m/semantic-release-semantic-release-1657

It looks like the semantic-release configuration might cause the problem, if you have nested arrays in the "release" configuration, e.g.

{
  "release": {
    "branches": [
      "main"
    ],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/github",
        {
          "assets": "generated/*.json"
        }
      ],
      "@semantic-release/npm"
    ]
  }
}

@mommack1234

This comment was marked as spam.

This was referenced Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants