file:///usr/local/server/src/function/src/main.js:1 import { Client, ID ,Users} from 'node-appwrite'; ^^ SyntaxError: The requested module 'node-appwrite' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export. For example: import pkg from 'node-appwrite'; const { Client, ID ,Users} = pkg; at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21) at async ModuleJob.run (internal/modules/esm/module_job.js:137:5) at async Loader.import (internal/modules/esm/loader.js:162:24) at async execute (/usr/local/server/src/server.js:126:32) at async /usr/local/server/src/server.js:158:13
what version of appwrite are you on?
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
Recommended threads
- AI feature by functions?
I'm creating a website where, in short, users can index certain genealogical content. In connection with the development of AI, I was thinking about introducing...
- Unknown usage from one of my database
I need support help. For more than 2 weeks, i didn't make any requests to my database, but I have noticed huge amount of reads and writes requests: Around 8000...
- AppwriteException: Missing required para...
I'm using node-appwrite sdk to retrive the documents. Example my code on pic, was define collectionId but error is still. Why?