diff --git a/NEXTJS_APP_ROUTER_INTEGRATION.md b/NEXTJS_APP_ROUTER_INTEGRATION.md new file mode 100644 index 00000000..32be7bc9 --- /dev/null +++ b/NEXTJS_APP_ROUTER_INTEGRATION.md @@ -0,0 +1,344 @@ +# Contribution Summary + +### Contributor: Meet Bhimani + +#### Date: 30-10-2024 + +--- + +## Overview + +I have integrated support for the Next.js app router (Next.js 14) into the project, improving compatibility and functionality. + +## Issues Addressed + +### 1. Compatibility Issue + +- **Description:** The previous implementation relied on `NextApiRequest` and `NextApiResponse`, which are incompatible with the new app router. +- **Solution:** Updated the handler functions to utilize `NextRequest` and `NextResponse` in the route handlers, ensuring compatibility with the app router. + +### 2. Error Related to the `fs` Module + +- **Description:** There were intermittent issues with the `fs` module not being found, stemming from the way the `ContentProvider` was wrapped. +- **Solution:** Instead of directly exporting the `ContentProvider` from `page.tsx`, I modified the export structure as follows: + +#### Updated `app/page.tsx` + +```javascript +import ContentProviderApp from './components/editor' +import { getStaticProps } from 'destack/build/server' + +export default async function Page() { + const props = await getStaticProps().then((d) => d.props) + + return ( +
+ At the same time, the fact that we are wholly owned and totally independent from manufacturer and other group + control gives you confidence that we will only recommend what is right for you. +
+ +