Back

How to attach vscode debugger to appwrite's nodejs runtime?

  • 0
  • Self Hosted
  • Functions
Loic Devaux
3 Jul, 2023, 22:09

Hi, I want a nodejs cloud function to run a command (flutter build web) on a docker container with flutter installed on it. I cant make it work on appwrite for now. This feature very much depends on the underlying stack so making it work on another runtime outside appwrite will not help me much. Is there a way to attach vscode debugger to the nodejs runtime used by appwrite so I can debug step by step ( like on the firebase emulator) ? I am supposing that the nodejs cloud function code is run inside the appwrite-worker-functions container, but I might be wrong.

TL;DR
The user wants to know how to attach a vscode debugger to appwrite's nodejs runtime. There is no solution provided in the thread, but the user is directed to open an issue on the appwrite GitHub repository to suggest the feature.
Drake
4 Jul, 2023, 00:03

Why do you need to run flutter build web? What exactly is your use case?

Loic Devaux
4 Jul, 2023, 01:40

I need to build browser extensions on the fly based on flutter apps, so I need to transpile it to javascript with flutter build web

Drake
4 Jul, 2023, 01:42

This can't be done as part of your CI jobs instead?

Loic Devaux
4 Jul, 2023, 02:17

I guess it could be handled by a CI tool but that would be a kind of overkill solution since I really only need to run this single command. But yes, let s say I am building a mini-CI tool with appwrite except the code is customers code, not mine.

Loic Devaux
4 Jul, 2023, 02:19

My question was more about debugging in general , could be php, nodejs , java etc... There comes a time where you need to stop the execution and use a debugger.

Drake
4 Jul, 2023, 02:19

Debugger is entirely a different topic. You won't be able to attach a debugger to an Appwrite function

Drake
4 Jul, 2023, 02:21

For this, I would suggest 👍 this issue and commenting with your use case: https://github.com/appwrite/appwrite/issues/1037

Although in the future, you might be able to install flutter as part of the function runtime build process

Loic Devaux
4 Jul, 2023, 02:36

I had a quick look inside appwrite code. It seems you use utopia php for docker container orchestration of the runtimes. It would certainly require some work but I don t see why technically speaking it would'nt be possible to attach a debugger inside a container.

Loic Devaux
4 Jul, 2023, 02:47

What I understand is that you suggest that I rebuild the nodejs image adding flutter so I could launch flutter build web straight from the cloud function js code.

Drake
4 Jul, 2023, 02:48

You could try that if you want. We don't support any of that, though

Loic Devaux
4 Jul, 2023, 03:21

Okay, I will try that. Thank you for your time Steven.

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