-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback for “@premieroctet/next-admin” #492
Comments
Hello @ak-fe-rottengrapes Are you encountering those issues ? Can you please elaborate about which page you get the issues on ? If you have a date formatting issue related to hydration, make sure to check the example app where we have a field that is formatted depending on the user's locale |
I just got this exact error @foyarash I'm using import { NextAdmin, PageProps } from "@premieroctet/next-admin";
import { getNextAdminProps } from "@premieroctet/next-admin/appRouter";
import prisma from "../../../prisma";
import "../../../nextAdminCss.css";
import options from "../../../nextAdminOptions";
type Params = Promise<{ slug: string }>
type SearchParams = Promise<{ [key: string]: string | string[] | undefined }>
export default async function AdminPage({
params,
searchParams
}: { params: Params, searchParams: SearchParams }) {
const props = await getNextAdminProps({
params: (await params).slug,
searchParams: await searchParams,
basePath: "/admin",
apiBasePath: "/api/admin",
prisma,
options
});
return <NextAdmin {...props} />;
} When I navigate to Clicking the error link, I get the same error shown in the OP. Any ideas? |
Exact same issue as @garrytrinder , upon navigating to the
|
Update: After downgrading |
Thank for solutions Also for version control it's pretty easy I don't why they didn't solved it |
Hello, it looks like to be an issue coming from the combination of React 19 + Next 15. That is my first guess as the example app is running Next 15 but with React 18. I'll have a look tomorrow at this issue as top priority. |
Hello, so I've been trying to run the example app with the combination of Next 15 and React 19, went to the This leads me to think that there might be some specific stuff that might be in your model's configuration that I might be missing. Would that be possible that you share the model's options ? Thank you |
For reference, here is a deployed version of Next 15 + React 19 https://next-admin-hi8evtm5u-premieroctet.vercel.app/ |
Could you let me know if 7.0.2 fixes it ? |
Currently my exam are going on. Once they are finished I will give you all
things you need
Also I get this error when I try to post some or try to get some data
I will give detailed information after my exam
…On Wed, 11 Dec, 2024, 10:35 pm Hugo FOYART, ***@***.***> wrote:
Could you let me know if 7.0.2 fixes it ?
—
Reply to this email directly, view it on GitHub
<#492 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLKHABCFUCDRVHJFIDIDNOL2FBWFPAVCNFSM6AAAAABSWUUY22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZWGU3TENBZHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Also if possible can you add the support for the GIS I should be able to see the map I have uploaded the geolocation in database |
Could you please open a new issue for this ? Thank you |
Hi @foyarash, at least on my side, the issue persists with version 7.0.2, exactly the same setup as @garrytrinder. Error message:
I am using next.js 15.0.3 and next-admin 7.0.2 |
This is so weird... Could you please send the following:
Thank you |
Thanks for the quick reply! I am using almost default values, and it's happening with a very simple model: My import type { NextAdminOptions } from "@premieroctet/next-admin";
const options: NextAdminOptions = {
title: "My awesome admin",
model: {},
};
export default options; My import { Config } from "tailwindcss";
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"node_modules@premieroctet/next-admindist/**/*.{js,ts,jsx,tsx}",
"./nextAdminOptions.{js,ts,jsx,tsx}",
],
darkMode: "class",
theme: {},
presets: [require("@premieroctet/next-admin/preset")],
} satisfies Config; My import { NextAdmin, PageProps } from "@premieroctet/next-admin";
import { getNextAdminProps } from "@premieroctet/next-admin/appRouter";
import prisma from "@/db/prisma";
import "../../../../nextAdminCss.css";
import options from "../../../../../../nextAdminOptions";
export default async function AdminPage({ params, searchParams }: PageProps) {
const { nextAdmin } = await params;
const search = await searchParams;
const props = await getNextAdminProps({
params: nextAdmin,
searchParams: search,
basePath: "/admin",
apiBasePath: "/api/admin",
prisma,
options,
});
return <NextAdmin {...props} />;
} My import prisma from "@/db/prisma";
import { createHandler } from "@premieroctet/next-admin/appHandler";
import options from "../../../../../nextAdminOptions";
import { bypassRLS } from "@/db/extensions";
import validateAuthenticated from "@/lib/auth/validate-authenticated";
import validateHasRole from "@/lib/auth/validate-has-role";
const { run } = createHandler({
apiBasePath: "/api/admin",
prisma: prisma.$extends(bypassRLS()),
onRequest: async () => {
await validateAuthenticated();
await validateHasRole("global_admin");
},
options,
});
export { run as DELETE, run as GET, run as POST }; Prisma schema of one of the models:
Given the error message, I suspect it has something to do with how the darkmode info is stored on the HTML? |
Thanks a lot, I'll have a look at it |
Sorry few more questions:
This is so strange because there is no place where we apply those attributes |
|
Could you try to set |
Just tried it, unfortunately it's the same issue. Not sure if this is relevant but I'm also getting this error the first time I run a clean build (second time goes through without error):
|
Are you using nextjs 15
…On Fri, 13 Dec, 2024, 9:07 pm Marian Lambert, ***@***.***> wrote:
Just tried it, unfortunately it's the same issue.
Not sure if this is relevant but I'm also getting this error the first
time I run a clean build (second time goes through without error):
Warning: You're using `next/head` inside the `app` directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-3-migrating-nexthead for more details.
warn - No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
warn - https://tailwindcss.com/docs/content-configuration
⨯ ./src/app/globals.css:1:1
Syntax error: src\app\globals.css The `border-border` class does not exist. If `border-border` is a custom class, make sure it is defined within a ***@***.***` directive.
> 1 | @tailwind base;
| ^
2 | @tailwind components;
3 | @tailwind utilities;
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|node_modules\next\dist\build\webpack\loaders\css-loader\src\index.js??ruleSet[1].rules[13].oneOf[10].use[2]!node_modules\next\dist\build\webpack\loaders\postcss-loader\src\index.js??ruleSet[1].rules[13].oneOf[10].use[3]!src\app\globals.css': No serializer registered for PostCSSSyntaxError
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> webpack/lib/ModuleBuildError -> PostCSSSyntaxError
GET /admin 500 in 27441ms
⨯ ./src/app/globals.css:1:1
src\app\globals.css The `border-border` class does not exist. If `border-border` is a custom class, make sure it is defined within a ***@***.***` directive.
—
Reply to this email directly, view it on GitHub
<#492 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLKHABG3BL26YHFA2V5HZGL2FL5M7AVCNFSM6AAAAABSWUUY22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBRG4YTSNZXHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@ak-fe-rottengrapes yes, next.js |
@mlxyz just notices you forgot some slashes in your tailwind config's content for the next-admin files, but i dont know if that will fix your issue |
Ok I was able to reproduce on a brand new clean Next 15 project. i'll investigate from there |
Oh my god I feel so stupid... You need to add I will definitely add this in the docs |
Got it working!
Now everything is working. Great support and great library, thanks! |
Good to know, that was a tricky one ! Thanks for all the details you gave in your previous posts |
Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used
if (typeof window !== 'undefined')
.Date.now()
orMath.random()
which changes each time it's called.It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
See more info here: https://nextjs.org/docs/messages/react-hydration-error
The text was updated successfully, but these errors were encountered: