@bobtail.software/b-ssr 1.0.12 → 1.0.13

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.
@@ -612,11 +612,22 @@ node_modules`),!r)return;let i=(0,Isr.default)({allowRelativePaths:!0}).add(r);r
612
612
  return await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply);
613
613
  `:`
614
614
  await getOptionsMaps();
615
- const options = renderOptionsMap.get('${f.url}');
616
- if (!options) throw new Error('Opciones loader no encontradas para: ${f.name}');
615
+ const options = renderOptionsMap.get('${f.url}');
616
+ if (!options) {
617
+ console.warn('\u26A0\uFE0F [B-SSR Warning] Opciones no encontradas temporalmente para: ${f.name}. Retornando {}.');
618
+ return {};
619
+ }
617
620
  const augmentedReq = Object.assign(Object.create(ssrContext.req), ${D});
618
621
  let customData = {};
619
- if (options.handler) customData = (await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply)) || {};
622
+ try {
623
+ if (options.handler) {
624
+ customData = (await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply)) || {};
625
+ }
626
+ } catch (handlerErr) {
627
+ console.error('\u274C [B-SSR Handler Error] ${f.name}:', handlerErr);
628
+ // Opcional: retornar {} o dejar que el error suba si quieres ver la pantalla de error de React
629
+ return {};
630
+ }
620
631
  if (ssrContext.reply.sent) return;
621
632
  return { ...customData };
622
633
  `;return`exports.${f.name} = async (${v.join(", ")}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobtail.software/b-ssr",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Fastify + Vite SSR Plugin wrapper with RPC",
5
5
  "author": "Victor Moreno <info@bobtail.software> (https://bobtail.software)",
6
6
  "license": "GPL-3.0",