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

Type error is thrown, when repository in package.json is a string, not an object #185

Closed
2 tasks done
capaj opened this issue Sep 24, 2021 · 2 comments · Fixed by #187
Closed
2 tasks done

Type error is thrown, when repository in package.json is a string, not an object #185

capaj opened this issue Sep 24, 2021 · 2 comments · Fixed by #187

Comments

@capaj
Copy link
Contributor

capaj commented Sep 24, 2021

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

x

Plugin version

x

Node.js version

16

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

Ubuntu 21.04

Description

a valid value like:
"repository": "github:nearform/mercurius-apollo-tracing",

causes error like this:

    TypeError: Cannot destructure property 'owner' of 'parseGitUrl(...)' as it is null.
        at github (/home/capaj/.nvm/versions/node/v16.7.0/lib/node_modules/releasify/lib/github.js:7:11)
        at module.exports (/home/capaj/.nvm/versions/node/v16.7.0/lib/node_modules/releasify/lib/commands/draft.js:63:18)
        at async module.exports (/home/capaj/.nvm/versions/node/v16.7.0/lib/node_modules/releasify/lib/commands/publish.js:106:21)
        at async Command.func (/home/capaj/.nvm/versions/node/v16.7.0/lib/node_modules/releasify/lib/cli.js:18:7)

Steps to Reproduce

use
"repository": "github:nearform/mercurius-apollo-tracing",

Expected Behavior

no type error is thrown for plain string value in repository

@climba03003
Copy link
Member

climba03003 commented Sep 24, 2021

I think it is supported.
https://github.com/jonschlinkert/parse-github-url/blob/master/test.js#L28

Maybe file a bug report to parse-github-url

@capaj
Copy link
Contributor Author

capaj commented Sep 24, 2021

oh yeah, the problem is not in parse-github-url.
Problem is releasify always assumes that the repository value in pkg.json is an object. It can be just a plain string.
I will rephrase the issue.

@capaj capaj changed the title repository is not parsed correctly when it is not a URL Type error is thrown, when repository in package.json is a string, not an object Sep 24, 2021
@climba03003 climba03003 linked a pull request Sep 24, 2021 that will close this issue
4 tasks
@Eomm Eomm closed this as completed in #187 Sep 29, 2021
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

Successfully merging a pull request may close this issue.

2 participants