Package not showing up from scoped registry server

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.

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

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

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

and the package.json inside the package looks like :

4682132--441137--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.

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

  1. I have tried adding and removing “/registry” from url of scoped registry:

“url”: “http://localhost:4873”,
or
“url”: “http://localhost:4873/registry”,

4682132--441140--Screen Shot 2019-06-24 at 4.52.01 PM.png

2 Likes

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

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

So you added the name of the package in Packages/manifest.json and it works now?

Pascal

Just to clarify, when I load the package from disk following this method: Unity - Manual: Install a UPM package from a local folder (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

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

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.

1 Like

@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!

@chayanvinayak If you look in the editor.log file, do you see the package listed after this line?:

[Package Manager] Registering XX packages:

@okcompute_unity : I see [Package Manager] Registering 38 Packages line but don’t see the signature of packages coming from Verdaccio.

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?

@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

4717997–446183–manifest.json.zip (972 Bytes)
4717997--446186--Screen Shot 2019-07-05 at 11.16.12 AM.png


@okcompute_unity Hey Pascal, just wanted to check if you had a chance to investigate?

@chayanvinayak Here’s a package I’ve uploaded to my registry and which then appears in the package manager window:

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.

2 Likes

@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: GitHub - xoofx/UnityNuGet: Provides a service to install NuGet packages into a Unity project via the Unity Package Manager and it worked for me.

Regards,

Pascal

1 Like

Thank you @Adrian and @okcompute_unity . “Showing preview packages” did the trick! :slight_smile:

1 Like

@okcompute_unity ,

  • is there any way to add dependency of a package coming from scoped registry?
  • sometimes even when “manifest.json” is reset Unity keeps showing older list of packages coming scoped registry (and doesn’t update package manager based on changes). Is there any folder which is needed to be cleaned to reset. (I tried cleaning “PackageCache” folder but didn’t help)?

Do you mean transitive dependency? If yes, as long as the name of the package matches the scoped registry, the Package Manager will fetch the dependency in the scoped registry. Transitive or root dependency.

This looks like a bug. Does this issue persist if you close the editor and restart? I’m wondering if this would be an issue with the UI holding on an invalid state by mistake.

@okcompute_unity

Transitive dependency is defined in the package.json of the package itself?

Yes, this persists even if editor is closed and restarted. Any modification in manifest.json also doesn’t change list of packages in Package manager. Is there any way I can reset the UI?

Yes, this is correct.

Root or direct dependencies are set in the project manifest (/Packages/manifest.json
Transitive or indirect dependencies are set in package manifest (package.json)

Ok, then this is not a UI issue. Can you share what the project manifest look like after and before? (you can DM the files if you want).