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: Method Date.prototype.toString called on incompatible receiver [object Date] #746

Closed
KevinNitroG opened this issue Dec 8, 2024 · 5 comments

Comments

@KevinNitroG
Copy link

I have searched for this issue in this repo, and it seems it was fixed (#675 (comment)). But I don't know why I still get this error. I have run npm update to update deps.

Here is the failed workflow

https://github.com/KevinNitroG/win-check-bat/actions/runs/12223495652/job/34095122919

My repo at the time failed

https://github.com/KevinNitroG/win-check-bat/tree/78d9486a9d9820e4a8c8113e58d81cb4f94e80d5

@travi
Copy link
Member

travi commented Dec 8, 2024

please search existing issues. for example, see #675 (comment)

you need to update semantic-release core and related plugins to be compatible with each other. you likely are using a preset package and are either ahead or behind with the version of that preset

@travi travi closed this as completed Dec 8, 2024
@KevinNitroG
Copy link
Author

KevinNitroG commented Dec 8, 2024

@travi Sorry I don't really understand what you said because I'm new to nodejs and semantic release. I just created my project yesterday and I believe that I'm using the latest version of semantic-release.

I have tried to install those plugins that I use (which are said to be default plugins and don't need to be installed manually in the docs) but it still fails.

Here's my packages' version now

{
    "semantic-release": "^24.2.0",
    "@semantic-release/commit-analyzer": "^13.0.0",
    "@semantic-release/github": "^11.0.1",
    "@semantic-release/npm": "^12.0.1",
    "@semantic-release/release-notes-generator": "^14.0.1"
}

edit:

Fixed with installing the preset I'm using

npm i -D conventional-changelog-conventionalcommits

@travi
Copy link
Member

travi commented Dec 9, 2024

"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/github": "^11.0.1",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1"

these do not need to be installed separately since they are already included as dependencies of the semantic-release package

@RbrtDdds
Copy link

 "@semantic-release/changelog": "^6.0.3",
    "@semantic-release/commit-analyzer": "^13.0.1",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/npm": "^12.0.1",
    "@semantic-release/release-notes-generator": "^14.0.3",

[8:10:32 PM] [semantic-release] › ✘ An error occurred while running semantic-release: TypeError: Method Date.prototype.toString called on incompatible receiver [object Date]
at Proxy.toString ()
at [Symbol.toPrimitive] ()
at new Date ()
at Object.formatDate (file:///builds/web/content-components/node_modules/conventional-changelog-writer/dist/utils.js:8:12)
at defaultCommitTransform (file:///builds/web/content-components/node_modules/conventional-changelog-writer/dist/options.js:23:23)
at transformCommit (file:///builds/web/content-components/node_modules/conventional-changelog-writer/dist/commit.js:29:23)
at write (file:///builds/web/content-components/node_modules/conventional-changelog-writer/dist/writers.js:39:28)
at async nextAsync (node:internal/streams/from:182:33) {
pluginName: '@semantic-release/release-notes-generator'
}

@travi
Copy link
Member

travi commented Jan 21, 2025

Don't depend on commit-analyzer, release-notes-generator, or the npm plug-in. They are already dependencies of semantic-release. You likely have conflicting versions

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

3 participants