Closed tanakamapondera closed 4 years ago
Step 1: Clone the application using git clone https://github.com/ButterCMS/buttercms-marketing-site-nextjs-react
Step 2: Install the dependencies using yarn install
Step 3: Create a .env file and add your ButterCMS API key inside it. It should be something like BUTTER_CMS_API_KEY=something
Step 4: Start your development server using yarn dev
The application should be up and running on http://localhost:3000/. I followed the same steps and it seemed to worked perfectly fine.
@tanakamapondera please let us know if this works for you
@ghoshnirmalya @jakelumetta Just tried out your suggestion and I got the following error. Might be something off with by environment, taking a look at it now
@tanakamapondera Can you share the data that you're receiving from ButterCMS API? You data
object is undefined
.
@ghoshnirmalya Sure but what do you mean by that? Screenshot what I have setup in ButterCMS?
@tanakamapondera By that I mean the data that ButterCMS is sending you when you're doing a request to its server.
@ghoshnirmalya Using the postman test provided by ButterCMS, I get data back from the server just fine actually. Posts: Pages:
I rechecked all my naming conventions and it looks like I had the wrong slug on one of the pages. So the "loading" error is gone but a new "map" error is now showing
@tanakamapondera Can you log this request in your browser through code and send me a screenshot? I understand that Postman is fetching the data. However, I need to understand if the data is getting fetched from the browser or not.
@ghoshnirmalya My apologies, here are the screenshots: Blog Posts:
Page:
@ghoshnirmalya So after a bit of reverse engineering, I finally have my site running locally and data is being pulled in from ButterCMS:
But I have identified 2 blockers: 1) NextJS does not like the "style.css" file, needs to be properly configured:
Also, there is an issue with the footer component:
Once I remove those two files, everything compiles successfully though. Did you every come across these errors?
@tanakamapondera
The latest version of Next.js supports CSS out of box. You might need to update the version of Next.js to resolve this issue.
For this issue, I think that navigation_links
is coming as undefined
from your API
@ghoshnirmalya
Makes sense, 1) has been solved.
Lastly, how did you setup navigation_links
? Is it possible to get a screenshot of the page setup in Butter? That wasn't covered in the tutorial that I am following: Full CMS with ButterCMS & Next JS
Again, thank you very much for your help!
@ghoshnirmalya As long as I don't use the footer component, then everything works. I think that's what I'll do for now until I figure out whats wrong
Thanks @ghoshnirmalya ! @tanakamapondera Let me know if you have any other issues / questions. Happy to help.
I just cloned the repo down, installed all the dependencies, added the buttercms api key and ran "yarn dev" but the app won't run. I get the following error message:
$ yarn dev yarn run v1.22.0 $ next [ wait ] starting the development server ... [ info ] waiting on http://localhost:3000 ... Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected. See here for more info: https://err.sh/next.js/built-in-css-disabled
Has anybody else come across this error? FYI: This is a fresh clone from master branch & I have no changed anything to the code