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

Site errors with 500 Internal Error status when deployed on vercel with Optimizely SAAS CMS #86

Open
pnittala opened this issue Jan 10, 2025 · 0 comments

Comments

@pnittala
Copy link

pnittala commented Jan 10, 2025

Hi,

I have forked this repository at this version (e7b75dc), followed the steps to setup on Optimizely SAAS instance. We have taken the necessary secret keys and configured on vercel and deployed the app. The home page was showing 500 internal error. I was seeing in the vercel log that the middleware was erroring out with the following error:

"Error running the exported Web Handler: [Error: No fetch event listeners found]".

The CMS was showing the site in visual builder however without editing capabilities.

Since seeing this middleware error, I commented the middleware chain and put in dummy middleware.

// export const middleware = withEditFallback((request: NextRequest) =>
// {
// // Make sure we have a known Visitor ID
// const visitorId = Session.getOrCreateVisitorId(request)
// const requestHeaders = new Headers(request.headers)
// requestHeaders.set('x-visitorid', visitorId)

// const response = NextResponse.next({
// request: {
// headers: requestHeaders
// }
// })
// Session.addVisitorId(response, visitorId)
// return response
// })

export const middleware = (request: NextRequest) =>
{
// Make sure we have a known Visitor ID
const requestHeaders = new Headers(request.headers)
const response = NextResponse.next({
request: {
headers: requestHeaders
}
})

return response

}

With this change, the vercel app showed up without 500 error. The home page now showed with navigation and 404 screen. When I visited the site/en it showed the moseybank site. The CMS was showing in visual editor the site, but without editing capabilities as before.

image

No editing boxes in Visual Editor as shown in the above image

  • Are you able to deploy this version (e7b75dc) to new Optimizely SAAS instance and deploy to vercel and see the site properly working?
  • Can you please let us know what the issue with middleware is.
  • What do we need to do fix this issue in the correct way?
  • What do we need to do to fix the editing capability on Visual Editor on SAAS CMS.

Any help in this regard is appreciated!

@pnittala pnittala changed the title Site errors with 500 Internal Error status on Vercel when deployed on vercel with Optimizely SAAS CMS Site errors with 500 Internal Error status when deployed on vercel with Optimizely SAAS CMS Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant