Wisp-CMS / nextjs-blog-cms-wisp

A Next.js 14 Blog using Server Components - backed by Wisp CMS
https://blog-demo.wisp.blog
MIT License
63 stars 25 forks source link

When env key is change #5

Open ChristopherAlphonse opened 3 months ago

ChristopherAlphonse commented 3 months ago

Something went wrong! Request failed with status code 500 AxiosError: Request failed with status code 500 at settle (webpack-internal:///(rsc)/./node_modules/axios/lib/core/settle.js:24:12) at IncomingMessage.handleStreamEnd (webpack-internal:///(rsc)/./node_modules/axios/lib/adapters/http.js:629:71) at IncomingMessage.emit (node:events:532:35) at endReadableNT (node:internal/streams/readable:1696:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) at Axios.request (webpack-internal:///(rsc)/./node_modules/axios/lib/core/Axios.js:57:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) DIGEST: 60112185

Screenshot 2024-08-04 163856

yehjxraymond commented 3 months ago

Hi can you help me understand how to reproduce the issue with some of the info:

Env: Window version? Have you copied .env.example to .env? Are there any console error in the browser??

yehjxraymond commented 3 months ago

I've upgraded one of the package that might have caused this issue, can you pull the latest code and see if that fixes it?

ChristopherAlphonse commented 2 months ago

when i get the key from my profile the server return 500 after writing two articles

ChristopherAlphonse commented 2 months ago

this works to view: NEXT_PUBLIC_BLOG_ID=clvlugru90000o4g8ahxp069s but once I add my own ID it no longer works

TheRealDzox commented 2 months ago

Same issue here. If I want to deploy the site to Vercel it throws this error:

Error: NEXT_PUBLIC_BLOG_ID is missing
    at /vercel/path0/.next/server/app/api/og-image/route.js:1:3458
    at 1542 (/vercel/path0/.next/server/app/api/og-image/route.js:1:4067)
    at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
    at 3770 (/vercel/path0/.next/server/app/api/og-image/route.js:1:4119)
    at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
    at 5020 (/vercel/path0/.next/server/app/api/og-image/route.js:1:584)
    at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
    at r (/vercel/path0/.next/server/app/api/og-image/route.js:1:5445)
    at /vercel/path0/.next/server/app/api/og-image/route.js:1:5472
    at t.X (/vercel/path0/.next/server/webpack-runtime.js:1:1206)
Build error occurred
Error: Failed to collect page data for /api/og-image
    at /vercel/path0/node_modules/next/dist/build/utils.js:1268:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}

Edit: After commiting the .env with the example the deploy worked. (I will definetly not do this with my own BlogID). Hopefully you find a fix for this :)

ChristopherAlphonse commented 2 months ago

@TheRealDzox yes once i add my own blog id it failed after two blogs, and failed to navigate to any pages taps

yehjxraymond commented 2 months ago

Hi @ChristopherAlphonse, can you perform the following:

Pull the latest code from this repo again or upgrade the wisp client in package.json to the following and run npm i:

"@wisp-cms/client": "^0.0.14",

We've recently addressed two separate issues that led to a 500 error, the first being a dated client calling a redirected endpoint and the second was a failure of the related post endpoint when there's a post without featured image is returned.

If this doesn't solve the issue, I'll love to get into a call with you to resolve it together.

yehjxraymond commented 2 months ago

@TheRealDzox You are missing the env variable on Vercel, it's a separate issue than what Christopher encountered. The reason is that the .env file does not get pushed (or it can pose security risk).

To solve the issue, you'll have to add the env variable on Vercel:

  1. Log in to vercel and go to your project page and click "Settings" CleanShot 2024-08-08 at 11 07 52
  2. Insert your env variable in and save it. CleanShot 2024-08-08 at 11 09 33
  3. Redeploy your site CleanShot 2024-08-08 at 11 11 00
TheRealDzox commented 2 months ago

Thanks :) Had the env configured in the team settings.

ChristopherAlphonse commented 2 months ago

@yehjxraymond let hop on a call later.

yehjxraymond commented 2 months ago

@ChristopherAlphonse Please let me know if you've tried the mentioned method. Also lmk know an email I can contact you at.

ChristopherAlphonse commented 2 months ago

christopheralphonse96@gmail.com