appwrite / templates

Templates for Appwrite Functions ⚑️🌩️
https://appwrite.io
MIT License
104 stars 81 forks source link

πŸ› Bug Report: Prompt-GPT nodejs fails #284

Closed xuelink closed 1 month ago

xuelink commented 1 month ago

πŸ‘Ÿ Reproduction steps

https://github.com/appwrite/templates/assets/3280475/4c0247e9-5789-4561-be99-07e3d5966b3f

πŸ‘ Expected behavior

it should run in anyway, i did one click setup.

πŸ‘Ž Actual Behavior

file:///usr/local/server/src/function/src/main.js:1
import { OpenAIApi } from 'openai';
         ^^^^^^^^^
SyntaxError: The requested module 'openai' does not provide an export named 'OpenAIApi'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:429:15)
    at async execute (/usr/local/server/src/server.js:142:32)
    at async action (/usr/local/server/src/server.js:174:13)
    at async /usr/local/server/src/server.js:10:9

🎲 Appwrite version

Appwrite Cloud

πŸ’» Operating system

Linux

🧱 Your Environment

cloud.appwrite.io 1.5.5

πŸ‘€ Have you spent some time to check if this issue has been raised before?

🏒 Have you read the Code of Conduct?

loks0n commented 1 month ago

fixed with https://github.com/appwrite/templates/commit/d6fbe861c9e2e7b74485ff346757815036a9eaf8