Search Unity

Verdaccio Scoped Packages fail, but unscoped packages working?

Discussion in 'Package Manager' started by taptpci, Nov 27, 2019.

  1. taptpci

    taptpci

    Joined:
    Jan 31, 2018
    Posts:
    8
    Unity 2018.4.0f1

    I have set up a local test Verdaccio, and have been trying to use scoped packages to obtain our packages in Unity but they can't be found. However unscoped packages succeed. I can verify that all packages exist in the scope (or unscope) expected on the file system.

    Fails
    Code (CSharp):
    1. // Package is scoped
    2. //
    3. // @com.company/package.name
    4. //
    5. // Unity fails to import this package.
    6. {
    7.   "scopedRegistries": [
    8.     {
    9.       "name": "packages",
    10.       "url": "http://localhost:myport",
    11.       "scopes": [
    12.         "com.company"
    13.       ]
    14.     }
    15.   ],
    16.   "dependencies": {
    17.     "com.company.package.name": "1.2.3",
    18.     ...
    19.   }
    20. }

    Succeeds
    Code (CSharp):
    1. // Package is unscoped
    2. //
    3. // com.company.package.name
    4. //
    5. // Unity succeeds at importing this package.
    6. // however, I MUST use the fully qualified package name in the scopes array
    7. //
    8. {
    9.   "scopedRegistries": [
    10.     {
    11.       "name": "packages",
    12.       "url": "http://localhost:myport",
    13.       "scopes": [
    14.         "com.company.package.name"
    15.       ]
    16.     }
    17.   ],
    18.   "dependencies": {
    19.     "com.company.package.name": "1.2.3",
    20.     ...
    21.   }
    22. }

    Is this expected behavior? Is this a bug? Is there something I'm doing wrong?


    Edit : Can verify that the scoped package is found in the browser, but not by Unity at this address...

    http : //localhost:myport/@com.company/package.name
     
    Last edited: Nov 27, 2019
  2. cassandraL

    cassandraL

    Unity Technologies

    Joined:
    Dec 7, 2017
    Posts:
    108
    Hello,
    Sorry to hear you have issues using the scoped registries feature.
    Unfortunately, your issue arises because scoped registries are only available from 2019.1 and upward.

    If you look in the Unity manual at https://docs.unity3d.com/Manual/upm-scoped.html, you can see that this feature is not available in 2018.4 by pressing the "Version" dropdown found in the top-left corner of the page, right below the page header.
     
    taptpci likes this.
  3. taptpci

    taptpci

    Joined:
    Jan 31, 2018
    Posts:
    8
    Thanks @cassandraL, I appreciate the clarification. As long as unscoped packages work in 2018, at the very least we could use those for internal tools until we are assured of migrating the entire team to 2019