fixing bug or error when build

This commit is contained in:
Ichsan Kurniawan
2026-01-28 20:01:35 +07:00
parent c1b41f0718
commit 885cb00e29
12 changed files with 27 additions and 159 deletions
+19
View File
@@ -34,3 +34,22 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
## Deploy on VPS
```bash
git clone hats-app.git
# then
cd hats-app
# then
npm install
# then
npm run build
# then
pm2 start npm --name "new-hats-app" -- start
```
```bash
# command
git clone https://ichsankurnia:<PERSONAL_ACCESS_TOKEN>@github.com/ichsankurnia/hats-app.git
```
-4
View File
@@ -7,10 +7,6 @@ import fetchData from '@/lib/fetchData';
const FormComponent = lazy(() => import('./components/FormComponent'))
export const metadata: Metadata = {
title: "Presence - HIS Attendance Task System (H.A.T.s)",
}
export async function generateMetadata({ searchParams }: any): Promise<Metadata> {
const checkout = (await searchParams)?.checkout
const title = checkout === 'true' ? 'Check-out Presence' : 'Check-in Presence'
+1 -1
View File
@@ -22,7 +22,7 @@ export async function generateMetadata(): Promise<Metadata> {
const session = await getServerSession(authOptions)
return {
title: `${session?.user?.detail.fullname || 'User'}'s Profile`,
title: `${session?.user?.detail.fullname || 'User'}'s Profile - H.A.T.s`,
}
}
+2 -2
View File
@@ -2,7 +2,7 @@ import { type Metadata } from 'next';
import { Suspense, lazy } from 'react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import LazyLoading from '@/components/loader/LazyLoading';
import fetchData from '@/lib/';
import fetchData from '@/lib/fetchData';
const ComponentPage = lazy(() => import('./component'));
@@ -12,7 +12,7 @@ export const metadata: Metadata = {
export default async function DeviceTypePage() {
const data = await ('/dayoff')
const data = await fetchData('/dayoff')
return (
<>
+2 -1
View File
@@ -3,6 +3,7 @@ import { revalidateTag } from 'next/cache'
export async function GET(request: NextRequest) {
const tag = request.nextUrl.searchParams.get('tag')
revalidateTag(tag!)
revalidateTag(tag!, { expire: 24 * 60 * 60 })
return NextResponse.json({ revalidated: true, now: Date.now() })
}
+1 -1
View File
@@ -11,7 +11,7 @@ import { ThemeProvider } from '@/providers/ThemeProvider'
import SessionProvider from '@/providers/SessionProvider'
import { Toaster } from '@/components/ui/sonner';
import AntdConfigProvider from '@/providers/AntdConfigProvider';
import ProgressBarProviders from './providers/ProgressBarProvider';
import ProgressBarProviders from '@/providers/ProgressBarProvider';
const jakarta = Plus_Jakarta_Sans({ subsets: ['latin'] })
-41
View File
@@ -1,41 +0,0 @@
'use client'
import { FC, ReactNode } from 'react';
import { ConfigProvider, theme as antdTheme } from "antd";
import { useTheme } from 'next-themes';
import { Inter } from 'next/font/google'
// import { StyleProvider } from '@ant-design/cssinjs';
const inter = Inter({ subsets: ['latin'] })
type Props = {
children: ReactNode
};
const AntdConfigProvider: FC<Props> = ({ children }) => {
const { systemTheme, theme } = useTheme()
const { defaultAlgorithm, darkAlgorithm } = antdTheme;
return (
<ConfigProvider
theme={{
algorithm: theme === 'dark' ? darkAlgorithm : theme === 'system' && systemTheme === 'dark' ? darkAlgorithm : defaultAlgorithm,
"token": {
"colorPrimary": 'rgb(113 113 122)',
// colorBgContainer: theme === 'dark' ? 'rgb(24, 24, 27)' : theme === 'system' && systemTheme === 'dark' ? 'rgb(24, 24, 27)' : '#ffffff',
colorBgContainer: theme === 'dark' ? 'rgb(9, 9, 11)' : theme === 'system' && systemTheme === 'dark' ? 'rgb(9, 9, 11)' : '#ffffff',
// colorTextPlaceholder: 'rgb(113, 113, 122)',
colorTextPlaceholder: 'rgb(161, 161, 170)',
colorBorder: theme === 'dark' ? 'rgb(39 39 42)' : theme === 'system' && systemTheme === 'dark' ? 'rgb(39 39 42)' : 'rgb(212 212 216)',
borderRadius: 5,
fontFamily: inter.style.fontFamily
}
}} componentSize='large'>
{/* <StyleProvider hashPriority="high"> */}
{children}
{/* </StyleProvider> */}
</ConfigProvider>
);
}
export default AntdConfigProvider;
-20
View File
@@ -1,20 +0,0 @@
'use client'
import React from 'react';
import { Toaster } from "@/components/ui/toaster"
type Props = {};
const ClientProvider: React.FC<Props> = () => {
return (
<>
<Toaster />
{/* OTHER CLIENT LIBRARY */}
{/* OTHER CLIENT LIBRARY */}
{/* OTHER CLIENT LIBRARY */}
</>
);
}
export default ClientProvider;
-20
View File
@@ -1,20 +0,0 @@
'use client';
import { ProgressProvider } from '@bprogress/next/app';
const ProgressBarProviders = ({ children }: { children: React.ReactNode }) => {
return (
<>
<ProgressProvider
height="4px"
color="#EA512C"
options={{ showSpinner: true }}
shallowRouting
>
{children}
</ProgressProvider>
</>
);
};
export default ProgressBarProviders;
-59
View File
@@ -1,59 +0,0 @@
'use client'
import { ReactNode } from 'react';
import { type Session } from 'next-auth';
import { SessionProvider as Provider } from 'next-auth/react'
type Props = {
children: ReactNode,
session: Session | null
basePath?: string
};
// function AppProvider({ children, basePath }: { children: ReactNode, basePath: string }) {
// const data = useSession({
// required: true,
// onUnauthenticated: () => {
// window.location.replace(`${basePath}/auth?error=SessionRequired&callbackUrl=${window.location.href}`)
// }
// })
// // ... custom code
// return (
// <>{children}</>
// )
// }
// const SessionProvider: React.FC<Props> = ({ children, session, basePath }) => {
// return (
// <>
// <Provider session={session}
// /* In case you use a custom path and your app lives at "/cool-app" rather than at the root "/" */
// /* PRODUCTION ONLY REMOVE THIS COMMENT */
// basePath={`${basePath}/api/auth`}
// /* Re-fetch session every 5 minutes => default (0) */
// // refetchInterval={5 * 60}
// /* Re-fetches session when window is focused => default (true), Use this value if not using refresh token */
// // refetchOnWindowFocus={false}
// >
// {/* <AppProvider basePath={basePath!}> */}
// {children}
// {/* </AppProvider> */}
// </Provider>
// </>
// );
// }
const SessionProvider: React.FC<Props> = ({ children, session }) => {
return (
<>
<Provider session={session}>
{children}
</Provider>
</>
);
}
export default SessionProvider;
-8
View File
@@ -1,8 +0,0 @@
"use client"
import { ThemeProvider as NextThemesProvider } from "next-themes"
import { type ThemeProviderProps } from "next-themes/dist/types"
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
}
+2 -2
View File
@@ -6,10 +6,10 @@
"author": "ichsankurnia",
"repository": {
"type": "git",
"url": "git+https://github.com/ichsankurnia/his-super-apps.git"
"url": "git+https://github.com/ichsankurnia/hats-app.git"
},
"bugs": {
"url": "https://github.com/ichsankurnia/his-super-apps/issues"
"url": "https://github.com/ichsankurnia/hats-app/issues"
},
"scripts": {
"dev": "next dev -p 1209",