Heyo.
Normally I don't run into these issues, but for some reason I cannot find this one out. There's some really weird things going on.
This is the beginning of my main.ts file:
import { Client, Databases, Account } from "node-appwrite";
import {
getUsers,
getUserSelf,
getUserData,
getUserDataSelf,
} from "@/utils/user-actions";
import { getEvents } from "@/utils/event-actions";
export const client = new Client();
export const account = new Account(client);
export const databases = new Databases(client);
export { ID } from "node-appwrite";
type Context = {
req: any;
res: any;
log: (msg: any) => void;
error: (msg: any) => void;
};
export default async ({ req, res, log, error }: Context) => {
But I am getting an error for the imports. :crey:
I tried looking in the template: https://github.com/appwrite/templates/blob/main/node-typescript/whatsapp-with-vonage/src/main.ts, however there you import files using .js even though the files are .ts..? Which also does not work. So confused on that.
What does your package.json look like?
Ah sorry didn't see your message.
{
"name": "function-user-endpoints",
"version": "1.0.0",
"description": "",
"author": "Faye",
"main": "src/main.ts",
"type": "module",
"scripts": {
"format": "prettier --write ."
},
"devDependencies": {
"@types/node": "^20.12.12",
"prettier": "^3.2.5"
},
"dependencies": {
"node-appwrite": "^12.0.1",
"typescript": "^5.4.5"
}
}
Recommended threads
- functions returning error 401 in local
I updated to 1.9.0, and the functions that used to work fine in 1.8.1 are now giving me a 401 error. I can't seem to find a solution. If anyone is running versi...
- Docker Compose MongoDB Setup
everythings work fine but the mongodb fails on startup everytime. log: ``` Generating random MongoDB keyfile... /bin/bash: line 9: : No such file or directory ...
- Auth broken after update from 1.8.0 to 1...
So ive been having issues creating, deleting or updating users on my appwrite instance after i updated from 1.8.0 to version 1.9.0. When trying to create a user...