Closed tevli closed 1 month ago
Hello @tevli
Thanks for the report, there was an issue with missing instructions about the installation of superjson, which is required for Page Router. This has now been added in CLI v0.0.3.
The locale
issue has also been resolved in v6.1.3 of the lib
Description
On installing next-admin using the cli, it generates the necessary files but then throws this error on /admin route. Here is my pages/admin/[[...nextadmin]].tsx file:
`import { AdminComponentProps, NextAdmin } from "@premieroctet/next-admin"; import { getNextAdminProps } from "@premieroctet/next-admin/pageRouter"; import { GetServerSideProps, InferGetServerSidePropsType } from "next"; import prisma from "../../lib/prisma"; import schema from "../../../prisma/json-schema/json-schema.json"; import options from "../../../nextAdminOptions"; import "../../../nextAdminCss.css";
export default function Admin(props: InferGetServerSidePropsType) {
const { basePath, apiBasePath, ...restProps } = props;
return ( <NextAdmin basePath={basePath} apiBasePath={apiBasePath} options={options} {...restProps} /> ); }
export const getServerSideProps: GetServerSideProps = async ({ req }) => await getNextAdminProps({ basePath: "/admin", apiBasePath: "/api/admin", prisma, schema, options, req, locale: "en", });
`
On further investigation, it seems the locale is not being passed from node_modules\@premieroctet\next-admin\dist\pageRouter.js to getPropsFromParams in node_modules\@premieroctet\next-admin\dist\utils\props.js thereby leaving the locale undefined.
Reproduction URL
https://github.com
Reproduction steps
Next router
Page router
Next Admin version
6.1.2
Screenshots
Next Admin options
Logs
Browsers
Chrome