ShahbaazX786 / tracker.io

A Issue Tracker using Nextjs 13
https://tracker-io-wheat.vercel.app
2 stars 2 forks source link

Fix the prisma error in console in dev mode. #15

Closed ShahbaazX786 closed 8 months ago

ShahbaazX786 commented 8 months ago

Error: PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in unknown).

This might be a dev mode only problem but better be sure.

avi-l commented 8 months ago

I believe the problem stems from here:

 "use client";

import LatestIssues from "@/components/LatestIssues";

export default function Home() {
  return (
    <>
      {/* <h1>Bismillah</h1> */}
      <LatestIssues />
    </>
  )
}

the 'use client' is forcing LatestIssues to be client instead of server. I commented this use client out in my branch for dark mode and it got rid of the error. Addressed in https://github.com/ShahbaazX786/tracker.io/pull/16

ShahbaazX786 commented 8 months ago

This issue is now resolved by @avi-l contributions. Hence marking this as close.