Skip to content
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

error TypeError: fetch failed when running pnpm run dev #64

Open
hoanganhchang opened this issue Aug 22, 2023 · 3 comments
Open

error TypeError: fetch failed when running pnpm run dev #64

hoanganhchang opened this issue Aug 22, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@hoanganhchang
Copy link

When running pnpm run dev, I got error:
error TypeError: fetch failed
`error TypeError: fetch failed

  • error src/lib/utils.ts (111:2) @ isMacOs
  • error ReferenceError: window is not defined
    at isMacOs (./src/lib/utils.ts:115:5)
    at Combobox (./src/components/combobox.tsx:102:91)
    109 |
    110 | export function isMacOs() {

111 | return window.navigator.userAgent.includes("Mac")
| ^
112 | }`

I'm use Apple M1 Pro.
Another error when I try pnpm run db:push .
Got an error: Error: self signed certificate in certificate chain
code: 'HANDSHAKE_SSL_ERROR',
errno: undefined,
sqlState: undefined

Please help. Many thanks!

@sadmann7
Copy link
Owner

I fixed the window is undefined error.

The second one looks unfamiliar to me. Did you try reinstalling after removing node_modules, and .next.

Also you need to put this at the end of the DATABASE_URL: ?ssl={"rejectUnauthorized":true}

The url will look like this: DATABASE_URL="mysql://YOUR_MYSQL_URL_HERE?ssl={"rejectUnauthorized":true}"

@sadmann7 sadmann7 added the bug Something isn't working label Aug 22, 2023
@B-YS
Copy link

B-YS commented Nov 29, 2023

I also got this error, here is my sql url DATABASE_URL="mysql://root:root@localhost:3306/sk5?ssl={"rejectUnauthorized":true}&&zeroDateTimeBehavior=convertToNull"

@richard16611
Copy link

any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants