The following routes were not configured to run with the Edge Runtime:

i get this error, to solve i add "export const runtime = 'edge';" but i dont have - /_error in the project and idk how to solve this error for this route, this is an existent project for example this _not-found was solved just creating the tsx file but this dont work with _error build command npx @Cloudflare/next-on-pages
1 Reply
Deo Kumar
Deo Kumar12mo ago
Create a not-found.tsx route with export const runtime = "edge"; Create a error.tsx route with "use client" directive:
"use client";

import React, { useEffect } from "react";

export default function ErrorPage({
error,
reset
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
}, [error]);

return (
<div>
<h2>Something went wrong!</h2>
<button
type="button"
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
>
Try again
</button>
</div>
);
}
"use client";

import React, { useEffect } from "react";

export default function ErrorPage({
error,
reset
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
}, [error]);

return (
<div>
<h2>Something went wrong!</h2>
<button
type="button"
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
>
Try again
</button>
</div>
);
}
Want results from more Discord servers?
Add your server