App Server dependencies of dependencies: Would this produce "Dependency not found" error?

In the example provided in the documentation, what if CustomComponent1 was also a dependency of MyLibrary.

  1. Would app server produce a 'Dependency not found" error?
  2. If so, is there a way to specify the dep-id for any dependencies of MyLibrary?
  3. Or are dependencies of dependencies not supported?

dep-id

If an application uses other apps as dependencies, it will refer to these apps with opaque identifiers. This option allows you to specify the name of the directory containing the dependency. The App Server looks for dependencies in the parent directory of the app (that is, dependency apps should be checked out next to the main app directory, not inside it).

You can specify multiple dependencies on the command line with multiple --dep-id flags:

--dep-id MAGTM7NPDRPPUAWY=MyLibrary --dep-id LUBRMCXK3R4FTTH3=CustomComponent1

or in a YAML config-file:

dep-id:
  "MAGTM7NPDRPPUAWY": "MyLibrary"
  "LUBRMCXK3R4FTTH3": "CustomComponent1"

From here

1 Like

My guess, not having using the standalone App Server at all (so maybe your guess is as good as mine):

  1. No. You probably need to include all dependences, including nested dependencies of the kind you describe, in the configuration (either command line or YAML).
1 Like

Hi @dsweet,

Dependencies of dependencies are certainly supported! You’ll need to provide --dep-id specifications for every dep-id in your app (you might need to examine the dependencies section of your anvil.yaml to find out which dep ID your app uses for an app – older apps use the app ID, but newer apps use an opaque string starting with dep_).

If both your main app and MyLibrary depend on CustomComponent1, they might use different dep-ids to refer to it. That’s OK - you can specify two --dep-id entries that point to the same app using different dep IDs!

2 Likes

@meredydd , Thank you.
I had tried that previously. However I was using an app-id for one of the dependencies. Changing it to the dep-id fixed my issue.
Thanks again.