Giter VIP home page Giter VIP logo

Comments (2)

wongprom avatar wongprom commented on May 25, 2024

What I had to do before adding Sanity v3 to this existing next 13 project

Node

  1. Changed node version v14.16.1 => to at least v16.20.2

Where to create Sanity Studio?

⚠️ Not in the frontend folder (we will embed Sanity Studio in our nextjs)

  1. I $ cd .. out one step from nextjs project

  2. $ npm create sanity@latest

    • Need to install the following packages:
      [email protected]
      Ok to proceed? (y) y
    •  Error: Failed to communicate with the Sanity API:
       Unauthorized - Session not found. You may need to login again with sanity login.
      
       For more information, see https://docs.sanity.io/help/cli-errors.
       at getOrCreateProject (~/.npm/_npx/64b24/node_modules/@sanity/cli/lib/_chunks/cli- 
       129.js:111:11)
       at async initSanity (~/.npm/_npx/789/node_modules/@sanity/cli/lib/_chunks/cli- 
       119.js:18411:415)
  3. $ sanity login

    •   zsh: command not found: sanity
  4. $ npm install --global sanity@latest

  5. $ npm create sanity@latest

    •  Error: Failed to communicate with the Sanity API:
       Unauthorized - Session not found. You may need to login again with sanity login.
  6. $ sanity login
    ❗️use same login type as you use when login to Sanity

    •  ewewfer
       Login type GitHub
      Login successful
  7. $ npm create sanity@latest

    •  Fetching existing projects
       ? Select project to use Create new project
       ? Your project name: Sanity For testing-1
       ? Use the default dataset configuration? Yes
       ✅ Creating dataset
       ? Project output path: /..../react/next/sanity-for-testing-1
       ? Select project template Clean project with no predefined schemas
       ? Do you want to use TypeScript? Yes
       ✅ Bootstrapping files from template
       ✅ Resolving latest module versions
       ✅ Creating default project files
       ? Package manager to use for installing dependencies? npm
      
    Success 🎉
    
  8. $ ls

    • campout connect-next-with-gql git-test
      hulu-2 testing-1 sanity-for-testing-1

    testing-1 is the name of my nextjs project. sanity-for-testing-1 is the Sanity Studio folder.

  9. $ cd sanity-for-testing-1

  10. $ npm run dev

    •  Checking configuration files...
       ✅ Sanity Studio using [email protected] ready in 1567ms and running at http://localhost:3333/  

Skärmavbild 2023-09-12 kl  17 53 49

DONE 🎉

from test-next-13.

wongprom avatar wongprom commented on May 25, 2024

Don't forget to add domain

Skärmavbild 2023-09-13 kl  12 23 36

from test-next-13.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.