elysiajs / elysia-static

Plugin for Elysia for serving static folder
MIT License
12 stars 15 forks source link

Invalid plugin type #28

Open nodirbekrajaboff opened 3 months ago

nodirbekrajaboff commented 3 months ago
@##### server % pm2 logs 0

[TAILING] Tailing last 15 lines for [0] process (change the value with --lines option) /Users/####/.pm2/logs/####-out.log last 15 lines: /Users/####/.pm2/logs/####-error.log last 15 lines: 0|#### | 29628 | return this._use(plugin2); 0|#### | 29629 | if (typeof plugin2.default === "function") 0|#### | 29630 | return plugin2.default(this); 0|#### | 29631 | if (plugin2.default instanceof _Elysia) 0|#### | 29632 | return this._use(plugin2.default); 0|#### | 29633 | throw new Error('Invalid plugin type. Expected Elysia instance, function, or module with "default" as Elysia instance or function that returns Elysia instance.'); 0|#### | ^ 0|#### | error: Invalid plugin type. Expected Elysia instance, function, or module with "default" as Elysia instance or function that returns Elysia instance. 0|#### | at /Users/####/Desktop/projects/####/server/build/index.js:29633:15 0|#### |

import { Elysia } from "elysia";
import { staticPlugin } from "@elysiajs/static";

export const app = new Elysia()
  .use(staticPlugin())
  .listen(4040);

Script:

bun build ./src/index.ts --outdir ./build --target=node