@bobtail.software/b-ssr 1.0.16 → 1.0.18

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.
@@ -585,7 +585,7 @@ node_modules`),!r)return;let i=(0,Isr.default)({allowRelativePaths:!0}).add(r);r
585
585
  }
586
586
  ${pe.join(`
587
587
  `)}
588
- `;a.set(g_.resolve(h),Ae)}catch(v){console.error(`[rpc-generator] Error al procesar ${h}:`,{error:v})}}function c(h){let p=Sor(h),f="";return p.length>0&&(f=`args: { ${p.join("; ")} }`),`export declare const ${h.name}: (${[f,"ssrContext?: { req: FastifyRequest, reply: FastifyReply }"].filter(Boolean).join(", ")}) => ${h.returnType};`}function l(h,p){return h.length===0?"":`
588
+ `;a.set(g_.resolve(h),Ae)}catch(v){console.error(`[rpc-generator] Error al procesar ${h}:`,{error:v})}}function c(h){let p=Sor(h),f="";return p.length>0&&(f=`args: { ${p.join("; ")} }`),`export declare const ${h.name}: (${[f,"ssrContext?: { req?: FastifyRequest, reply?: FastifyReply }"].filter(Boolean).join(", ")}) => ${h.returnType};`}function l(h,p){return h.length===0?"":`
589
589
  let rpcOptionsMap, renderOptionsMap, loaderApiOptionsMap;
590
590
  async function getOptionsMaps() {
591
591
  if (rpcOptionsMap && renderOptionsMap) return;
@@ -616,6 +616,10 @@ node_modules`),!r)return;let i=(0,Isr.default)({allowRelativePaths:!0}).add(r);r
616
616
  `:v.type==="api"?P=`
617
617
  await getOptionsMaps();
618
618
  const options = loaderApiOptionsMap.get('${v.url}');
619
+ if (!options?.handler) {
620
+ console.warn('\u26A0\uFE0F [B-SSR Warning] Handler API aun no cargado para: ${v.name} (${v.url}). Retornando null.');
621
+ return null;
622
+ }
619
623
  if (!options?.handler) throw new Error('Handler no encontrado para API Loader: ${v.name}');
620
624
  const augmentedReq = Object.assign(Object.create(ssrContext.req), ${C});
621
625
  return await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobtail.software/b-ssr",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
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",