You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running various CLI commands using the yalc package, if the package.json file does not contain a version key, the resulting error message is unclear and misleading. It seems that the lack of a version key may not be properly handled, leading to an unexpected error in path operations.
Steps to Reproduce
Ensure package.json does not include a version key.
Run a CLI command such as yalc publish or yalc add.
Observe the error output.
Expected Behavior
The tool should either handle the missing version key gracefully by providing a clear error message indicating the absence of the version key or handle the operation assuming defaults.
Actual Behavior
The tool throws a TypeError related to path operations, which does not clearly communicate the issue related to the missing version key in package.json.
Error Output
TypeError[ERR_INVALID_ARG_TYPE]: The"path"argumentmustbeoftypestring.ReceivedundefinedatnewNodeError(node:internal/errors:399:5)atvalidateString(node:internal/validators:163:11)atObject.join(node:path:1172:7)at<filepathremovedforprivacy>atnewPromise(<anonymous>)
at __awaiter (<filepathremovedforprivacy>)
at exports.copyPackageToStore (<filepathremovedforprivacy>) {code: 'ERR_INVALID_ARG_TYPE'}
(Note: File paths and user identifiers have been removed for privacy.)
A potential improvement could be to validate the existence of the version key before proceeding with operations that depend on it, and if it is missing, throw a clear and descriptive error message.
The text was updated successfully, but these errors were encountered:
When running various CLI commands using the yalc package, if the package.json file does not contain a version key, the resulting error message is unclear and misleading. It seems that the lack of a version key may not be properly handled, leading to an unexpected error in path operations.
Steps to Reproduce
Ensure package.json does not include a version key.
Run a CLI command such as yalc publish or yalc add.
Observe the error output.
Expected Behavior
The tool should either handle the missing version key gracefully by providing a clear error message indicating the absence of the version key or handle the operation assuming defaults.
Actual Behavior
The tool throws a TypeError related to path operations, which does not clearly communicate the issue related to the missing version key in package.json.
Error Output
(Note: File paths and user identifiers have been removed for privacy.)
Additional Information
Node version: v18.16.0
yalc version: 1.0.0-pre.53
Operating System: MacOS
Suggested Fix
A potential improvement could be to validate the existence of the version key before proceeding with operations that depend on it, and if it is missing, throw a clear and descriptive error message.
The text was updated successfully, but these errors were encountered: