Back

Using typescript cloud function give me error on build function

  • 0
  • Functions
Mosh Ontong
10 Dec, 2023, 12:34
TypeScript
{
  "name": "starter-template",
  "version": "1.0.0",
  "description": "",
  "main": "dist/main.js",
  "type": "module",
  "scripts": {
    "format": "prettier --write .",
    "build": "tsc"
  },
  "dependencies": {
    "livekit-server-sdk": "^1.2.7",
    "node-appwrite": "^9.0.0",
    "typescript": "^5.1.6"
  },
  "devDependencies": {
    "@types/node": "^20.4.7",
    "prettier": "^3.0.0"
  }
}
TypeScript
{
  "$id": "657579ca608ed1b0f105",
  "name": "video",
  "runtime": "node-18.0",
  "execute": [],
  "events": [],
  "schedule": "",
  "timeout": 15,
  "enabled": true,
  "logging": true,
  "entrypoint": "dist/main.js",
  "commands": "npm install && npm run build",
  "ignore": ["node_modules", ".npm", "dist"],
  "path": "functions/video"
}
TypeScript
TL;DR
The user is encountering an error when building a TypeScript cloud function. They mentioned that there may be issues with Bun v1 and suspect that the git commit may not be correct. They migrated TypeScript into JavaScript and it deployed successfully. The user is using Appwrite and is unable to see the package.json file. They asked about the folder structure and deployment method. The user provided their package.json and function configuration. Solution: It seems the issue might be with the Bun v1, so the user can try using a different version. Additionally, they can check if the git commit is correct. If migrating TypeScript to JavaScript already deployed successfully, they
Drake
10 Dec, 2023, 15:27

How did you deploy?

Mosh Ontong
10 Dec, 2023, 15:47

manual

Drake
10 Dec, 2023, 15:56

How exactly?

Mosh Ontong
10 Dec, 2023, 15:58

appwrite deploy function

Drake
10 Dec, 2023, 18:12

And what's your folder structure?

Mosh Ontong
11 Dec, 2023, 00:30
Mosh Ontong
11 Dec, 2023, 00:30
Mosh Ontong
11 Dec, 2023, 00:30
Drake
11 Dec, 2023, 00:38

Weird... Appwrite can't see the package.json file...

Drake
11 Dec, 2023, 00:40

Does Appwrite have the right version of the code?

Mosh Ontong
11 Dec, 2023, 00:49

I just follow this

Mosh Ontong
11 Dec, 2023, 00:49
Mosh Ontong
11 Dec, 2023, 00:49

npm run build*

Mosh Ontong
11 Dec, 2023, 00:50

I think so? becauase I already did migrated typescript into javascript and it succesfully deployed

Mosh Ontong
11 Dec, 2023, 00:51

and this is also my reference

Drake
11 Dec, 2023, 00:55

From the function deployment, you can see the git commit. Does that look right?

Mosh Ontong
11 Dec, 2023, 00:55

Bun might be the option to use typescript but it some issue on BUn v1

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