mirror of
https://github.com/eggent-ai/eggent.git
synced 2026-05-13 15:46:00 +00:00
fix(build): limit instrumentation to node runtime
This commit is contained in:
5
src/instrumentation.node.ts
Normal file
5
src/instrumentation.node.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { initTelegramLifecycle } from "@/lib/telegram/polling-lifecycle";
|
||||
|
||||
initTelegramLifecycle().catch((error) => {
|
||||
console.error("Failed to initialize Telegram lifecycle:", error);
|
||||
});
|
||||
@@ -1,12 +1,5 @@
|
||||
export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === "edge") {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const { initTelegramLifecycle } = await import("@/lib/telegram/polling-lifecycle");
|
||||
await initTelegramLifecycle();
|
||||
} catch (error) {
|
||||
console.error("Failed to initialize Telegram lifecycle:", error);
|
||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||
await import("./instrumentation.node");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user