@e7w/easy-routes 0.1.5 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -3
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -411,7 +411,11 @@ filePaths.forEach((filePath) => {
411
411
  };
412
412
  await system.init(req)?.catch?.(() => {});
413
413
  const ctx = system.getCtx(req, meta.permission);
414
- await meta.loader?.(ctx)?.catch?.(() => {});
414
+ try {
415
+ await meta.loader?.(ctx);
416
+ } catch (error) {
417
+ console.error(error);
418
+ }
415
419
  if (!ctx.signed) return redirect(`/login?from=${encodeURIComponent(request.url)}`);
416
420
  if (ctx.noPermission) return redirect("/403");
417
421
  document.title = ctx.title;
@@ -452,11 +456,12 @@ filePaths.forEach((filePath) => {
452
456
  if (finished1 && finished2) break;
453
457
  }
454
458
  });
455
- obj["/"].errorElement = /* @__PURE__ */ jsx(ErrorBoundary, {});
456
459
  routes.push({
457
460
  path: "/",
458
461
  element: /* @__PURE__ */ jsx(ProgressLayout, {}),
459
- children: [obj["/"]]
462
+ children: [obj["/"]],
463
+ errorElement: /* @__PURE__ */ jsx(ErrorBoundary, {}),
464
+ hydrateFallbackElement: /* @__PURE__ */ jsx(Loading, {})
460
465
  });
461
466
  routes.push({
462
467
  path: "*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e7w/easy-routes",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"