Localhost Server Is Not Connecting

When I go to another page on the website does says if want to go to localhost:3000/blog whenever the website loads the page the server disconnects from the server:

Hey @xbrandonpowell it looks there is an issue with your integration. Could you share your code from [[…page.tsx]] and your folder structure?

This is all what is inside of this page: I did not touch this file or change nothing:

import { builder } from "@builder.io/sdk";
import { RenderBuilderContent } from "../../components/builder";

// Builder Public API Key set in .env file
builder.init(process.env.NEXT_PUBLIC_BUILDER_API_KEY);

export default async function Page(props) {
  const content = await builder
    // Get the page content from Builder with the specified options
    .get("page", {
      userAttributes: {
        // Use the page path specified in the URL to fetch the content
        urlPath: "/" + (props?.params?.page?.join("/") || ""),
      },
    })
    // Convert the result to a promise
    .toPromise();

  return (
    <>
      {/* Render the Builder page */}
      <RenderBuilderContent content={content} />
    </>
  );
}

Are you adding your public API key here?

So the code i post say has it

First of I have .env I have .env file with public API in there so do not understand what you mean if public API is in .env file.

Hi @manish-sharma,

I’m encountering a problem where my server disconnects every time I navigate to a different page, and I’m unsure how to address it. @sheema suggested adding the public API Key within my code, but I’ve already done that as per her instructions.

Have you ever faced a situation where the server prevents you from navigating to other pages and simply disconnects from your local host? Any insights would be greatly appreciated.

Hey @xbrandonpowell could you please share your folder structure with me?

Hello @xbrandonpowell,

If you are using node v20 then consider using node v18 or node v19 to resolve this issue.

This outdated:

All up to date, audited 459 packages in 548ms it says


updated to date.

This is weird @manish-Sharma and @sheema because I have followed everything because with updating every correctly and still does not work.

Still running into this error will push it up to my GitHub:

If you all have found what issues, please let me know. Thank you for all your help within the community and this has been a very great experience.

Hello @xbrandonpowell,

Could you please run the following command from the terminal and let us know the Node.js version you are currently using?

node -v

v20.9.0 this updated version

@sheema and @manish-sharma because was always lost and confused Node.js on how to correctly download different versions if I have v20 go the nodejs.org where do I go to down node v18 or node v19 to resolve this issue.

Hello @xbrandonpowell,

You can use nvm to install node version 18.

1 Like