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

Support for snapshot versions #202

Closed
rrigoni opened this issue Jun 14, 2024 · 3 comments
Closed

Support for snapshot versions #202

rrigoni opened this issue Jun 14, 2024 · 3 comments
Labels
more info needed More information is needed to resolve the issue

Comments

@rrigoni
Copy link

rrigoni commented Jun 14, 2024

Why this library throws the following error if I use any release different than {major}.{minor}.{patch}? Anything like {major}.{minor}.{patch}-snapshot or even {major}.{minor}.{patch}.something throws the following error:

Run JS-DevTools/npm-publish@v2
  with:
    token: ***
    package: ./package.json
Error: InvalidPackageVersionError: Package version must be a string, got "undefined"

Happening with node 18 on github actions.

@mcous
Copy link
Member

mcous commented Jun 14, 2024

Hi @rrigoni, it looks like you're not using the latest version of this action, which includes at least one important fix related to the version string: #161. Is this occurring in a public repository? If so, I'd be happy to take a look if you could provide me with a link.

This error occurs if your package.json#version field is not parsable by node-semver. semver.valid allows "prerelease" versions, so I suspect something is likely wrong with your package.json file

const semver = require("semver")

console.log('Valid?', semver.valid('1.2.3-snapshot'))
// Logs `Valid? 1.2.3-snapshot`

I recommend that you

  • Update to the latest version (v3) of the action
  • Double check that your version field in package.json is set correctly

@mcous mcous added the more info needed More information is needed to resolve the issue label Jun 19, 2024
@mcous
Copy link
Member

mcous commented Jun 19, 2024

@rrigoni are you still having an issue here? I am unable to reproduce any issues with snapshot versions; my tests are showing successful publishing of prerelease packages

@mcous
Copy link
Member

mcous commented Jun 27, 2024

Closing due to lack of reproduction or activity

@mcous mcous closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More information is needed to resolve the issue
Projects
None yet
Development

No branches or pull requests

2 participants