Skip to content
Back

Using a local package inside of a cloud function

  • 0
  • Functions
  • Cloud
guyluz11
14 Aug, 2025, 00:10

Hey all

I am trying to understand if what I want is possible or I am looking at it wrong. I am trying to use the a local package inside of my Dart cloud function, learned that it can't be done when the package is in a different folder in the project.

So I tried 2 other options and got error so shearing here with you to understand if it is possible.

  1. Copy the pacakge into the cloud function folder and referance it in the pubspec.yaml as ''' dependencies: path: dart_core

'''

For this one I am getting the error as if it can't find the folder, and it exist insid of the cloud function when deployed. ''' Resolving dependencies... Because llm depends on dart_core from path which doesn't exist (could not find package dart_core at "dart_core"), version solving failed. '''

  1. Use a symbolic link to the package location, tried that and it didn't worked, seems less likely to work then option one.

This is my function config, dart_core is inside of llm folder ''' 'id': server.llmFunctionId, 'runtime': 'dart-3.5', 'entrypoint': 'lib/main.dart', 'timeout': 90, 'specification': 's-0.5vcpu-512mb', 'execute': ['any', 'guests'], 'name': 'llm', 'enabled': true, 'logging': true, 'scopes': <String>[], 'events': <String>[], 'schedule': '', 'commands': 'dart pub get', 'path': 'functions/llm', '''

TL;DR
Developers are trying to use a local package in a Dart cloud function but are facing errors. They tried copying the package into the cloud function folder and setting a reference in the pubspec.yaml but got an error. They also tried using a symbolic link without success. The issue seems to be with path resolution.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more