# NextJs Integration

**URL:** <https://forum.builder.io/t/nextjs-integration/393>\
**Category:** Technical Questions\
**Tags:** react, nextjs\
**Created:** [January 13, 2021, 10:20am UTC](https://forum.builder.io/t/nextjs-integration/393 "2021-01-13T10:20:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zbigiman](https://avatars.discourse-cdn.com/v4/letter/z/7feea3/32.png) [@zbigiman](https://forum.builder.io/u/zbigiman)\
**Post date:** [January 13, 2021, 10:20am UTC](https://forum.builder.io/t/nextjs-integration/393/1 "2021-01-13T10:20:50Z")

</div>

I’m trying to integrate @builder.io with NextJs following this documentation:

> **[BuilderIO/builder](https://github.com/BuilderIO/builder/tree/master/examples/next-js)**
>
> master/examples/next-js

I’m trying to set the page URL for my home page: `http://localhost:3000/` but after saving the slash is added for the beginning `/` so it’s: `/http://localhost:3000/` ☹

 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/96cba915d60e568209938612f9241019eb81bbad.png)

My code is:

```auto
import React from 'react'
import { builder, BuilderComponent } from '@builder.io/react'

builder.init('e26d3532deff4a8a9528e21f334150fd')

const About = ({ builderPage }) => {
  console.log(builderPage)
    return (
      <div>
        {builderPage ? (
          <BuilderComponent model="page" content={builderPage} />
        ) : (
          <h1>404 Page not found</h1>
        )}
      </div>
    )

}

About.getInitialProps = async ({ res, req, asPath }) => {
  // If there is a Builder page for this URL, this will be an object, otherwise it'll be null
  const page = await builder.get('page', { req, res, url: asPath }).promise()
  return { builderPage: page }
}

export default About;

```

And the `console.log(builderPage)` returns null

Finally I want to deploy the website to AWS via `@sls-next/serverless-component`

Please help to solve it. My big client wants to use @builder.id but we need to have it integreted with NextJS and serverless deploy.

---

<div class="post-metadata">

**Author:** ![zbigiman](https://avatars.discourse-cdn.com/v4/letter/z/7feea3/32.png) [@zbigiman](https://forum.builder.io/u/zbigiman)\
**Post date:** [January 13, 2021, 12:38pm UTC](https://forum.builder.io/t/nextjs-integration/393/2 "2021-01-13T12:38:05Z")

</div>

I’ve changed the page URL to `/` and it works, so the documentation seems to be deprecated…

---

<div class="post-metadata">

**Author:** ![aziz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/aziz/32/2551_2.png) [@aziz](https://forum.builder.io/u/aziz)\
**Post date:** [February 10, 2021, 5:51pm UTC](https://forum.builder.io/t/nextjs-integration/393/3 "2021-02-10T17:51:21Z")

</div>

Thanks @zbigiman for pointing this out, we’ve updated our next-js starters with a clearer readme and the latest next-js version, you can find a minimal starter here [builder/examples/next-js-simple at master · BuilderIO/builder · GitHub](https://github.com/BuilderIO/builder/tree/master/examples/next-js-simple)

---

<div class="post-metadata">

**Author:** ![maya](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@maya](https://forum.builder.io/u/maya)\
**Post date:** [March 19, 2021, 12:00am UTC](https://forum.builder.io/t/nextjs-integration/393/4 "2021-03-19T00:00:11Z")

</div>

Hi Aziz,

I’ve tried to use the snippets in my NextJS v10 project, and even tried to run the `next-js-simple` repo out-of-the-box, but it always seems to result in a 404. I think the culprit is the `builder.get()` function.

I really love what you guys are doing and would love to offer [builder.io](http://builder.io) to our clients, but I can’t even seem to get a simple example to work!

Thanks,  
Maya

---

<div class="post-metadata">

**Author:** ![aziz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/aziz/32/2551_2.png) [@aziz](https://forum.builder.io/u/aziz)\
**Post date:** [March 19, 2021, 9:25pm UTC](https://forum.builder.io/t/nextjs-integration/393/5 "2021-03-19T21:25:07Z")

</div>

Hi @Maya, thanks for reporting the issue, the nextjs-simple starter had an issue with unpublished pages that we fixed yesterday, please pull from master and try again.
