Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Internal Server Error 500

default discord avatar
taun21602 years ago
2

Hi. After changing payload.config settings to include globals I'm receiving an Internal Server error 500 at localhost:3000.



Any ideas? The config file looks fine. No errors are returning in the terminal.



Here's the repo:

https://github.com/taunhealy/2160-Lodge-Bukela-2

 import { buildConfig } from 'payload/config';
import dotenv from 'dotenv';
import Page from './collections/Page';
import Media from './collections/Media';
import Portfolio from './collections/Portfolio';
import MegaMenu from './globals/MegaMenu';
import SocialMedia from './globals/SocialMedia';
import Footer from './globals/Footer';

dotenv.config();

export default buildConfig({
  serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL,
  collections: [
    Page,
    Media,
    Portfolio,
  ],
  globals: [
    MegaMenu,
    SocialMedia,
    Footer,
  ],
});


 GET http://localhost:3000/_next/static/chunks/fallback/main.js?ts=1680165083579 net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1          GET http://localhost:3000/_next/static/chunks/fallback/pages/_app.js?ts=1680165083579 net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1          GET http://localhost:3000/_next/static/chunks/fallback/pages/_error.js?ts=1680165083579 net::ERR_ABORTED 500 (Internal Server Error)
DevTools failed to load source map: Could not load content for chrome-extension://ppkojackhibeogijphhfnamhemklmial/js/page.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
favicon.ico:1          GET http://localhost:3000/favicon.ico 500 (Internal Server Error)


Internal Server Error 500

  • default discord avatar
    kris0x2 years ago

    hey

    @479030528084017165

    i think i have similar issue. well what works for me is to delete node module and install them again. (weird i know haha)

  • default discord avatar
    taun21602 years ago

    Thanks

    @160874396897116160

    . I opened the project on a different PC and the console returned this error:

    Server Error
    TypeError: Cannot read properties of undefined (reading 'slug')
    
    This error happened while generating the page. Any console logs will be displayed in the terminal window.
    Source
    pages\[...slug].tsx (63:48) @ slug
    
      61 | 
      62 | export const getServerSideProps: GetServerSideProps = async (ctx) => {
    > 63 | const slug = 'ctx.params?.slug' ? (ctx.params.slug as string[]).join('/') : 'home';
         |                                              ^
      64 | 
      65 | const pageQuery = await payload.find({
      66 |   collection: 'pages',
    Call Stack
    func
    pages\index.tsx (8:9)
    Show collapsed frames


    The problem was that my slug was stored as a string, so I removed the ' ' and it works now.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.