Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

TypeError being returned when the site loads #2

Open
sgriffiths opened this issue Oct 30, 2020 · 2 comments
Open

TypeError being returned when the site loads #2

sgriffiths opened this issue Oct 30, 2020 · 2 comments

Comments

@sgriffiths
Copy link

Im getting the following error after building and doing npm run dev:
Screen Shot 2020-10-30 at 1 23 24 pm

If I return an empty object/array the page loads but there is no blog content. Perhaps there is a dependancy missing from the readme ?

Addtional notes
Sanity is running fine
.env.local created and 'SANITY_API_TOKEN' pointing to 'write' API token in sanity
running latest npm/node and also tried with Yarn

Any help would be welcomed. The blog site is running fine on Vercel. Issue lies when trying to run this locally

brob added a commit that referenced this issue Nov 11, 2020
@brob
Copy link
Contributor

brob commented Nov 12, 2020

Sorry about the issue with this. An earlier version of the Starter didn't have the right env variable naming conventions for Next.js to run client side with the API. If you look at this updated .env template file and update your .env.local, it should clear things up locally:

https://github.com/sanity-io/sanity-template-nextjs-blog-comments/blob/main/template/.env.test

@kongweiying2
Copy link

Could you update the starter on the website with these instructions? This problem chewed up a lot of time for me.

https://www.sanity.io/create?taskId=SyNOeWRyGZxOTULAdkJU&template=sanity-io%2Fsanity-template-nextjs-blog-comments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants