Search Unity

Package not showing up from scoped registry server

Discussion in 'Package Manager' started by chayanvinayak, Jun 25, 2019.

  1. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    I am trying to access Unity packages from a scoped registry server that I am running locally using Verdaccio.

    What I have done so far:
    I am running a scoped registry server using Verdaccio and I have successfully published a package on the server which I can verify by going on webpage hosted on the server.


    Screen Shot 2019-06-24 at 4.19.14 PM.png

    In unity, I have modified manifest.json to include "scopedRegisteries"

    Screen Shot 2019-06-24 at 4.23.06 PM.png

    and the package.json inside the package looks like :

    Screen Shot 2019-06-24 at 4.26.50 PM.png

    What I expect:
    After going through above mentioned steps, I expect Unity package to show up in Package Manger's list.

    What is the problem:
    Package name is not showing up in package manager and there is no error shown in Unity.

    What I also tried:
    1. Adding "registry" in project manifest gives error.

    Screen Shot 2019-06-24 at 4.52.40 PM.png

    2. I have tried adding and removing "/registry" from url of scoped registry:

    "url": "http://localhost:4873",
    or
    "url": "http://localhost:4873/registry",
     

    Attached Files:

    Last edited: Jun 25, 2019
    christoph_r and amarcolina like this.
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    527
    Hi @chayanvinayak ,

    Have you tried to manually add a package from your scoped registry into the project manifest? If not, can you try? Does the package gets added to your project?

    Regards,

    Pascal
     
  3. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    Hey Pascal(@okcompute_unity ),

    Thanks for getting back!
    yes, I tried loading the same package from disk which worked fine and I could see a new folder loaded in the "Packages" folder in Unity project.

    Thanks,
    Chayan
     
    Last edited: Jun 26, 2019
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    527
    So you added the name of the package in
    Packages/manifest.json
    and it works now?

    Pascal
     
  5. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    Just to clarify, when I load the package from disk following this method: https://docs.unity3d.com/Manual/upm-ui-local.html (which modifies manifest.json), the package appears in the project but when I try loading it through scoped registry server (using the method I posted above), it does not appear.

    There is one more thing that I noticed.
    When I start Verdaccio and then load Unity project with manifest file updated, I see following log in Verdaccio.

    Log:
    chayan-mbp:~ chayan$ verdaccio
    warn --- config file - /Users/chayan/.config/verdaccio/config.yaml
    warn --- Plugin successfully loaded: verdaccio-htpasswd
    warn --- Plugin successfully loaded: verdaccio-audit
    warn --- http address - http://0.0.0.0:4873/ - verdaccio/4.0.4
    http --> 304, req: 'GET https://registry.npmjs.org/registry' (streaming)
    http --> 304, req: 'GET https://registry.npmjs.org/registry', bytes: 0/0
    http <-- 404, user: null(127.0.0.1), req: 'GET /registry/-/all', error: no such file available

    it looks like Unity is trying to get : 'GET /registry/-/all'
    which fails
     
    Last edited: Jun 28, 2019
  6. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    527
    Hi, @chayanvinayak,

    Package Manager uses the
    /-/all
    route to fetch the list of packages to be shown in the UI. We have an implementation in the work to fetch the list from the npm's V1 API instead (the
    /-/all
    route is deprecated). That said, I've looked at Verdaccio code base and it looks like they still support the
    /all
    path. Maybe your instance is misconfigured? Can you ask the Vedaccio maintainers why this route is not available on your instance? If you do, please let us know!

    Regards,

    Pascal
     
    Last edited: Jun 28, 2019
  7. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    327
    I can confirm packages show up using Verdaccio when the registry is added using scopedRegistries. Just checked with Unity 2018.4 and 2019.3a and this worked with Verdaccio 3 and still works with Verdaccio 4.
     
    okcompute_unity likes this.
  8. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    @okcompute_unity : I uninstalled and reinstalled Verdaccio4. Now /-/all error is gone but for some reason I still don't see the package name in Package manager or the folder in the Unity project.

    @Adrian: Can you please post your example package that shows up?

    Thank you guys!
     
  9. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    527
    @chayanvinayak If you look in the *editor.log* file, do you see the package listed after this line?:

    [Package Manager] Registering XX packages:
     
  10. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    @okcompute_unity : I see [Package Manager] Registering 38 Packages line but don't see the signature of packages coming from Verdaccio.
     
  11. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    527
    That is weird. You should have, at least, errors if the Package Manager cannot add scoped packages in your project! Can you share your project manifest?
     
  12. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    @okcompute_unity
    I am attaching :
    1. manifest file
    2. a screenshot of Verdaccio to show a package with the signature is available (through Verdaccio server)
    3. a screenshot of package manager in Unity showing packages available
    4. a screenshot of verdaccio output
     

    Attached Files:

  13. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    @okcompute_unity Hey Pascal, just wanted to check if you had a chance to investigate?
     
  14. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    327
    @chayanvinayak Here's a package I've uploaded to my registry and which then appears in the package manager window:
    https://github.com/sttz/trimmer

    Note that custom packages are never "verified" packages and therefore always considered "preview". You need to have "Advanced" > "Show preview packages" checked for your packages to show up.
     
    chayanvinayak likes this.
  15. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    527
    @chayanvinayak I've set up a scoped registry on my end and everything works fine. Have you selected the `Advanced => Show preview packages` option like @Adrian suggested?

    If you want to try another *scoped registry*, I was playing with this one today: https://github.com/xoofx/UnityNuGet and it worked for me.

    Regards,

    Pascal
     
    chayanvinayak likes this.
  16. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    18
    okcompute_unity likes this.