NextResponse.rewrite from middleware does not seem to render the page correctly, anyone else experie
NextResponse.rewrite from middleware does not seem to render the page correctly, anyone else experience this too?
chris.scholarcrafter.com/_next/... when they exist at scholarcrafter.com/_next/...npx wrangler pages deployment tailrevalidateTag and/or revalidatePath? Currently I get an internal server error when trying to call them from Cloudflare Pages. revalidateTag? Any estimations for it?Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performancedeployment tail trick) and create an issue if it's a next-on-pages bug. Thanks @James !https://scholarcrafter.com/chris/, req.url)@neondatabase/serverless with the error message Reflect.get called on non-object. I've checked the issue raised on this page https://github.com/cloudflare/next-on-pages/issues/499.<form action={myServerAction} />export const runtime = 'edge' on both files and it still wouldn't runchris.scholarcrafter.com/_next/...scholarcrafter.com/_next/...npx wrangler pages deployment tailrevalidateTagrevalidateTagrevalidatePathCannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performancedeployment tailhttps://scholarcrafter.com/chris/Reflect.get called on non-object<form action={myServerAction} />export const runtime = 'edge'export async function generateStaticParams() {
const response = await getRequest("PROJECTS");
const projects: Project[] = await response.json();
if (!projects || projects.length === 0) {
return [];
}
return projects.map((project) => ({
name: project.name.toLowerCase().replaceAll(" ", "-"),
}));
}
const Project = async ({ params }: { params: { name: string } }) => {
const response = await getRequest("PROJECTS");
const projects: Project[] = await response.json();
if (!projects || projects.length === 0) {
return <div>No projects available</div>;
}
const specificProject = projects.find(
(project) => project.name.toLowerCase().replaceAll(" ", "-") === params.name
);
if (!specificProject) {
return <div>Project not found</div>;
}
return <ProjectPage project={specificProject} />;
};
export default Project;export async function createTask(formData: FormData) {
const cookieStore = cookies();
const supabase = createClient(cookieStore);
const rawFormData = Object.fromEntries(formData.entries());
const newTaskData = {
title: rawFormData.title,
description: rawFormData.description,
completed: rawFormData.status === 'true',
due_date: rawFormData.due_date,
};
const { error } = await supabase.from('tasks').insert(newTaskData);
if (error) {
console.error('Error creating task:', error.message);
throw error;
}
redirect('/');
}import Link from 'next/link';
import { createTask } from '@/app/lib/actions';
export default async function Page() {
return (
<div className="flex justify-center w-full">
<div className="flex justify-center w-full px-2 sm:px-4 md:w-3/4">
<form action={createTask} className="w-full lg:w-3/4">
// form code
</form>
</div>
</div>
);
}