@lolyjs/core 0.3.0-alpha.1 → 0.3.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -9991,11 +9991,15 @@ var getServerFile = async (projectRoot, fileName) => {
9991
9991
  // modules/server/init.ts
9992
9992
  var INIT_FILE_NAME = "init.server";
9993
9993
  async function runInitIfExists(projectRoot, serverData) {
9994
- let mod = await getServerFile(projectRoot, INIT_FILE_NAME);
9995
- if (typeof mod?.init === "function") {
9996
- const serverContext = { ...serverData };
9997
- await mod.init({ serverContext });
9998
- return serverContext;
9994
+ try {
9995
+ let mod = await getServerFile(projectRoot, INIT_FILE_NAME);
9996
+ if (typeof mod?.init === "function") {
9997
+ const serverContext = { ...serverData };
9998
+ await mod.init({ serverContext });
9999
+ return serverContext;
10000
+ }
10001
+ } catch (error) {
10002
+ console.error(`[Init] Failed to load or execute ${INIT_FILE_NAME}.ts:`, error);
9999
10003
  }
10000
10004
  return {};
10001
10005
  }