nextjs-blog-cms-wisp icon indicating copy to clipboard operation
nextjs-blog-cms-wisp copied to clipboard

When env key is change

Open ChristopherAlphonse opened this issue 1 year ago • 12 comments

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

ChristopherAlphonse avatar Aug 04 '24 20:08 ChristopherAlphonse

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 avatar Aug 05 '24 02:08 yehjxraymond

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?

yehjxraymond avatar Aug 05 '24 02:08 yehjxraymond

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

ChristopherAlphonse avatar Aug 07 '24 23:08 ChristopherAlphonse

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

ChristopherAlphonse avatar Aug 07 '24 23:08 ChristopherAlphonse

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 :)

TheRealDzox avatar Aug 07 '24 23:08 TheRealDzox

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

ChristopherAlphonse avatar Aug 08 '24 00:08 ChristopherAlphonse

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 avatar Aug 08 '24 03:08 yehjxraymond

@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

yehjxraymond avatar Aug 08 '24 03:08 yehjxraymond

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

TheRealDzox avatar Aug 08 '24 06:08 TheRealDzox

@yehjxraymond let hop on a call later.

ChristopherAlphonse avatar Aug 08 '24 13:08 ChristopherAlphonse

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

yehjxraymond avatar Aug 10 '24 06:08 yehjxraymond