Back

Function Shared Folder not in workspace

  • 0
  • Tools
  • Functions
  • Self Hosted
  • Web
kampfmodz
24 Oct, 2023, 18:54

Hello I have an functions folder and in the parent directory is an shared types folder. Everytime i deploy the project it tells me ```Preparing pnpm@latest for immediate activation...  ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "types@workspace:*" is in the dependencies but no package named "types" is present in the workspace

This error happened while installing a direct dependency of /usr/local/build ``` How can i add the folder to the workspace

TL;DR
Title: Shared Folder Not Included in Workspace Deployment Messages: - The shared folder needs to be set in the appwrite.json configuration file. - Running 'appwrite deploy function' resets the Execute Access, requiring manual resetting. - To fix this, place the appwrite.json file in the src folder. - The error "'File '/usr/local/build/types/src/index.ts' is not under 'rootDir' '/usr/local/build/src'" can be resolved by creating a symlink. - Symlinks can be created using the 'ln' command for Unix systems. - An example of a function with a shared folder symlink can
Drake
24 Oct, 2023, 21:11

Your parent directory is probably not included in the code that is deployed. One way to make sure it's included is to use symlinks.

kampfmodz
25 Oct, 2023, 09:08

Is there an global way to do this in github? Like for Mac and Windows

Drake
25 Oct, 2023, 18:08

It doesn't matter how it's deployed. It only matters if you have the symlinks in there

kampfmodz
25 Oct, 2023, 18:09

can you give me an example how i create one?

Drake
25 Oct, 2023, 18:09

For example, this function here has a common folder that is a symlinks: https://github.com/stnguyen90/places/tree/feature/1.3-upgrade/appwrite-functions/create-photo/src

kampfmodz
25 Oct, 2023, 18:10

ok and how do i create this? with mklink?

Drake
25 Oct, 2023, 18:10

You can Google the exact syntax. For unix, it's the ln command

kampfmodz
25 Oct, 2023, 18:16

ok but now i get this error TS6059: File '/usr/local/build/types/src/index.ts' is not under 'rootDir' '/usr/local/build/src'. 'rootDir' is expected to contain all source files. The file is in the program because: Matched by default include pattern '**/*' File is ECMAScript module because '/usr/local/build/types/package.json' has field "type" with value "module"  ELIFECYCLE  Command failed with exit code 2.

kampfmodz
25 Oct, 2023, 18:17

nvm fixed it just had to put it in src, thanks for the help

kampfmodz
25 Oct, 2023, 18:18

but can you help me out once more? everytime i run appwrite deploy function the Execute Access resets and i have to set it manualy. Is there something in the appwrite.json i have to set?

Drake
25 Oct, 2023, 18:27
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