diff --git a/packages/define-remix-app/src/manifest-to-router.tsx b/packages/define-remix-app/src/manifest-to-router.tsx
index bc2bd308..5ead4545 100644
--- a/packages/define-remix-app/src/manifest-to-router.tsx
+++ b/packages/define-remix-app/src/manifest-to-router.tsx
@@ -290,16 +290,9 @@ function lazyCompAndLoader(
ErrorBoundary?: React.ComponentType;
};
return {
- default: () => {
- if (moduleWithComp.ErrorBoundary) {
- onCaughtError({ filePath, exportName: 'ErrorBoundary' });
- return ;
- }
- if (!isRootFile) {
- throw new Error(`ErrorBoundary not found at ${filePath}`);
- }
- return
error boundary not found at {filePath}
;
- },
+ default: () => (
+
+ ),
};
})
: undefined;
@@ -343,3 +336,24 @@ function useDispatcher(dispatcher: Dispatcher) {
}, [dispatcher]);
return state;
}
+
+function ErrorPage({
+ moduleWithComp,
+ filePath,
+ onCaughtError,
+}: {
+ moduleWithComp: {
+ ErrorBoundary?: React.ComponentType;
+ };
+ onCaughtError: ErrorReporter;
+ filePath: string;
+}) {
+ navigation.setNavigateFunction(useNavigate());
+
+ if (moduleWithComp.ErrorBoundary) {
+ onCaughtError({ filePath, exportName: 'ErrorBoundary' });
+ return ;
+ }
+
+ return error boundary not found at {filePath}
;
+}
diff --git a/packages/define-remix-app/src/page-template.ts b/packages/define-remix-app/src/page-template.ts
index a6414719..31119fff 100644
--- a/packages/define-remix-app/src/page-template.ts
+++ b/packages/define-remix-app/src/page-template.ts
@@ -20,7 +20,7 @@ return params;
const ${compIdentifier} = () => {
const params = useLoaderData();
return
-${[...varNames].map((name) => `
${clearJsxSpecialCharactersFromText(name)}: {params["${name}}"]
`).join('\n')}
+${[...varNames].map((name) => `
${clearJsxSpecialCharactersFromText(name)}: {params["${name}"]}
`).join('\n')}
;
};
export default ${compIdentifier};