
My function structure looks like this:
kotlin
- src
- Main.kt
- static
- index.html
Entry point for the function is src/Main.kt
I'm getting java.lang.reflect.InvocationTargetException
and Caused by: java.io.FileNotFoundException: ../static/index.html (No such file or directory)
errors.
The code I'm using to read files is:
val text = File("../static/index.html").readText()
I've also tried
val fileName = Paths.get("..", "static", "index.html")
val fileString = Files.readString(fileName)
and many others without any luck.

For anyone else finding this, the problem is the kotlin code is compiled into a jar and static files included in your function aren't bundled into the jar. We may need to update open runtimes to add support for static files.
Recommended threads
- Query.equal error
Hi guys. I'm using Appwrite Cloud, and I'm using version 21 of node-appwrite to benefit from transactions. The problem is I seem to be getting an error when I u...
- Appwrite messaging api error
```=== Push Notification Function Started === Endpoint: https://fra.cloud.appwrite.io/v1 Project: 6899062700398ffeae4f Database: threed-dating-db Notification f...
- function unable to detect client ip
Hi I have hosted appwrite on self hosted server. Currently I don't have any domain. I am accessing through ip. I have created one function which should detect t...
