@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.cjs CHANGED
@@ -10027,11 +10027,15 @@ var getServerFile = async (projectRoot, fileName) => {
10027
10027
  // modules/server/init.ts
10028
10028
  var INIT_FILE_NAME = "init.server";
10029
10029
  async function runInitIfExists(projectRoot, serverData) {
10030
- let mod = await getServerFile(projectRoot, INIT_FILE_NAME);
10031
- if (typeof mod?.init === "function") {
10032
- const serverContext = { ...serverData };
10033
- await mod.init({ serverContext });
10034
- return serverContext;
10030
+ try {
10031
+ let mod = await getServerFile(projectRoot, INIT_FILE_NAME);
10032
+ if (typeof mod?.init === "function") {
10033
+ const serverContext = { ...serverData };
10034
+ await mod.init({ serverContext });
10035
+ return serverContext;
10036
+ }
10037
+ } catch (error) {
10038
+ console.error(`[Init] Failed to load or execute ${INIT_FILE_NAME}.ts:`, error);
10035
10039
  }
10036
10040
  return {};
10037
10041
  }