'Server Error Error: Configuration must contain projectId‘

I followed this tutorial: https://youtu.be/mx1dbMzd3tU

When i try to connect sanity and next i get this error

Server Error Error: Configuration must contain projectId‘



Solution 1:[1]

This error comes up when you're missing the projectId. You have to use projectId when creating your Sanity client instance:

const client = sanityClient({
  projectId: 'yourproject-id',
  dataset: 'your dataset',
  token: 'Sanity build token',
  apiVersion: 'v1',
  useCdn: false // `false` if you want to ensure fresh data
})

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sven