unjs / citty

🌆 Elegant CLI Builder
Other
729 stars 23 forks source link

Doesn't work as a binary #125

Closed malezjaa closed 6 months ago

malezjaa commented 6 months ago

Environment

node: v21.6.2 citty: ^0.1.6

Reproduction

https://github.com/malezjaa/elmen/blob/main/src/index.ts#L71

Describe the bug

I have a string argument called name: image

It works fine when running locally: image

But when i upload the package to npm and download it, it says Cannot access properties of null (reading name) even though args object contains the name: image

Additional context

No response

Logs

No response

peterroe commented 6 months ago

The above error is caused by the following code:

https://github.com/malezjaa/elmen/blob/d1ae0b513c8104732ab52681c586b3f0e29c22c5/src/index.ts#L97

You could check your code logic to make sure it work correctly. :)

malezjaa commented 6 months ago

Thank you. I am really sorry for the trouble