Giter Site home page Giter Site logo

next-blog's Issues

Responsive Login [Authlinks]

Hello i'm new with develope and found that responsive <640 has been lost "Login" (When user aren't login yet)

image

image

Prisma client error

when im putting the data of post in a prisma studio , it gives me this error , Type: undefined
Message:
Invalid prisma.post.create() invocation:

{
data: {
slug: "1",
title: "1",
desc: "klad",
img: "/fashion.png",
views: 0,
cat: {
connect: {
? id?: String,
? slug?: String,
? AND?: CategoryWhereInput | CategoryWhereInput[],
? OR?: CategoryWhereInput[],
? NOT?: CategoryWhereInput | CategoryWhereInput[],
? title?: StringFilter | String,
? img?: StringNullableFilter | String | Null,
? Posts?: PostListRelationFilter
}
},
user: {
connect: {}
},
comments: {}
},
select: {
id: true,
createdAt: true,
slug: true,
title: true,
desc: true,
img: true,
views: true,
catSlug: true,
cat: true,
userEmail: true,
user: true,
comments: true
}
}

Argument connect of type CategoryWhereUniqueInput needs at least one of id or slug arguments. Available options are listed in green.

Code: undefined

Query:
[object Object]

however ! i have read and change the code , but still i am getting this error while creating posts in prisma studio ,

Untitled

Error: data?.map is not a function

src\components\categoryList\CategoryList.jsx (24:15) @ map

22 |

Popular Categories


23 |

24 | {data?.map((item) => (
| ^
25 | <Link
26 | href="/blog?cat=style"
27 | className={${styles.category} ${styles[item.slug]}}

Unable to fetch posts on production server, encountering client-side exceptions.

I am facing issues fetching posts on the production server of my Next.js application. The application throws an “Application error: a client-side exception has occurred” message. This issue does not occur in local development (http://localhost:3000).

Steps to Reproduce:

1.Navigate to a post page on the production server, e.g., https://domain-name/posts/[slug].
2.Observe the browser console for errors.
3.Note the network requests and responses, especially for chunk files like page-[slug].js.

Expected Behavior:

Posts should load successfully on the production server, similar to how they load in local development.

Actual Behavior:

Encountering client-side exceptions, specifically 404 Not Found errors for chunk files like page-[slug].js.

Screenshot

Screenshot 2024-06-28 at 3 20 31 PM

Environment:

Local Development: Works as expected.
Production Server: Fails to fetch posts, encountering client-side exceptions.

Category pagination Issue

There is a issue in a pagination component with regards to category

Kindly find the below modified code.

Hope you find it useful.


"use client"
import { useRouter } from 'next/navigation';
import styles from './pagination.module.css'

function Pagination({ page, hasPrev, hasNext, cat }) {

const router = useRouter()

return (


{
cat !== undefined ?
<>
<button className={styles.button}
disabled={!hasPrev}
onClick={() => router.push(?page=${page - 1}&cat=${cat})}
>
Previous Page

<button
className={styles.button}
disabled={!hasNext}
onClick={() => router.push(?page=${page + 1}&cat=${cat})}
>
Next Page

</>

      :
      <>
        <button className={styles.button}
          disabled={!hasPrev}
          onClick={() => router.push(`?page=${page - 1}`)}
        >
          Previous Page
        </button>

        <button
          className={styles.button}
          disabled={!hasNext}
          onClick={() => router.push(`?page=${page + 1}`)}
        >
          Next Page
        </button>
      </>

  }





</div>

);
}

export default Pagination;

prisma error

Invalid prisma.user.create() invocation:

Inconsistent column data: Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got: "clmegb4vn0001tqbkp5k5t8j2", length 25 for the field 'id'

Error: data?.map is not a function..

ff

I tried many alternatives from the internet,
not able to pin down the issue and I believe its to do with route.js but not able to solve this issue.

Can someone suggest?

Deployment Failure on Vercel for /write Route with React Quill

Description:

I'm encountering a deployment failure on Vercel specifically related to the /write route in my Next.js application. The /write route utilizes the React Quill package and seems to be causing issues during deployment.

Steps to Reproduce:

Attempt deployment on Vercel.
Observe the deployment logs or error messages specifically related to the /write route.

Expected Behavior:
The deployment on Vercel should proceed successfully for all routes, including the /write route using React Quill.

Actual Behavior:
The deployment breaks or encounters errors specifically when handling the /write route, causing the deployment to fail on Vercel.

problem in deploy

TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: Error: connect ECONNREFUSED ::1:3000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 3000
}
}

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
✓ Generating static pages (13/13)

Export encountered errors on following paths:
/page: /
/write/page: /write

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.