-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial is not compatible with Sanity V3 #47
Comments
Hi @RobWattCT ,
|
The fact is sanity v3 and v2 has various connection process however the v2 method works for v3. The only difference for me was to use npm run dev on the backend folder instead of sanity start. Other than that everything is still the same. Good luck. |
Just wondering if you have some steps to get this working in V3? |
Specifically in the index.js files and export as stated, everything should work perfectly even with version 3 but the React Tooltip is deprecated in this version to "Tooltip ", and at the backend, Sanity start is now npm run dev |
Thanks, i decided to recreate the project from scratch fresh sanity install. Though I'm having the issue with the tooltip. Any chance you can post a code snippet from skills.jsx? |
You can do this schema at export const schemaTypes = [
{
name: 'works',
title: 'Works',
type: 'document',
fields: [
{
name: 'title',
title: 'Title',
type: 'string',
},
{
name: 'description',
title: 'Description',
type: 'string',
},
{
name: 'projectLink',
title: 'Project Link',
type: 'string',
},
{
name: 'codeLink',
title: 'Code Link',
type: 'string',
},
{
name: 'imgUrl',
title: 'ImageUrl',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'tags',
title: 'Tags',
type: 'array',
of: [
{
name: 'tag',
title: 'Tag',
type: 'string'
}
]
},
],
},
{
name: 'testimonials',
title: 'Testimonials',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'company',
title: 'Company',
type: 'string'
},
{
name: 'imgurl',
title: 'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'feedback',
title: 'Feedback',
type: 'string'
}
]
},
{
name: 'brands',
title: 'Brands',
type: 'document',
fields: [
{
name: 'imgUrl',
title: 'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'name',
title: 'Name',
type: 'string'
}
]
},
{
name: 'abouts',
title: 'Abouts',
type: 'document',
fields: [
{
name: 'title',
title: 'Title',
type: 'string'
},
{
name: 'description',
title: 'Description',
type: 'string'
},
{
name: 'imgUrl',
title: 'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
]
},
{
name: 'skills',
title: 'Skills',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'bgColor',
title: 'BgColor',
type: 'string'
},
{
name: 'icon',
title: 'Icon',
type: 'image',
options: {
hotspot: true,
},
},
]
},
{
name: 'workExperience',
title: 'Work Experience',
type: 'document',
fields: [
{
name: 'name',
title: 'name',
type: 'string'
},
{
name: 'company',
title: 'Company',
type: 'string'
},
{
name: 'desc',
title: 'Desc',
type: 'string'
}
]
},
{
name: 'experiences',
title: 'Experiences',
type: 'document',
fields: [
{
name: 'year',
title: 'Year',
type: 'string'
},
{
name: 'works',
title: 'Works',
type: 'array',
of: [{ type: 'workExperience' }]
},
]
},
{
name: 'contact',
title: 'Contact',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'email',
title: 'Email',
type: 'string'
},
{
name: 'message',
title: 'Message',
type: 'text'
}
]
}
] |
The prompt to use typescript is not showing anymore and it automatically installs all the files of typescript. Anyone know how to change this???] |
For the people having trouble with the different versions of Sanity What you have to do is to import your file name into the script.js file inside the schemas folder:
You create the "testimonials" file as instructed in the video and skip creating a chema.js file |
|
The steps in the video do not work with the latest version of Sanity, version 3.
i.e. It's no longer possible to follow the exact steps of the video's Sanity setup and result in getting the Sanity Server up and running with the schema displaying.
There's a new prompt to setup the project for TypeScript (yes/no ?). Need clarity on that.
The project uses a schema.js file inside /schemas/, but installing the latest Sanity generates index.js file, with different code to schema.js (excluding what gets added to pull in the project's other schemas files).
It would be great if this could be addressed or if I could get some help on a workaround as I would love to build this tutorial without roadblocks.
@adrianhajdin and team, I love your work! Thank you for investing into the community.
The text was updated successfully, but these errors were encountered: