Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Troubleshooting an Undefined Error in a Schema File

7 replies
Last updated: Jan 4, 2023
Hello,So I made the mistake of trying to integrate shopify into my project and upgrading to v3 at the same time haha.

I am pretty sure I did the update right, I am getting a undefined error for my products though. Was wondering if you guys can check my schema file as see if its v3 compliant
Jan 4, 2023, 8:04 PM
/ Editor Imports
// Buttons
import buttonMain from "./components/editor/buttons/buttonMain";
import buttonAlt from "./components/editor/buttons/buttonAlt";
import buttonHero from "./components/editor/buttons/buttonHero";
import buttonSubmit from "./components/editor/buttons/buttonSubmit";
import buttonCard from "./components/editor/buttons/buttonCard";
import buttonIcon from "./components/editor/buttons/ButtonIcon";
// Cards
import bioCard from "./components/editor/cards/bioCard";
import picCard from "./components/editor/cards/picCard";
import picCardAlt from "./components/editor/cards/picCardAlt";
import iconCard from "./components/editor/cards/iconCard";
import contactCard from "./components/editor/cards/contactCard";
import infoCard from "./components/editor/cards/infoCard";
import serviceCard from "./components/editor/cards/serviceCard";
import bioCardAlt from "./components/editor/cards/bioCardAlt";
import backgroundCard from "./components/editor/cards/backgroundCard";
import priceCard from "./components/editor/cards/priceCard";
import linkCard from "./components/editor/cards/linkCard";
import faqCard from "./components/editor/cards/faqCard";
import flipCard from "./components/editor/cards/flipCard";
import blogCard from "./components/editor/cards/blogCard";
// CardArrays
import backgroundCards from "./components/editor/cards/cardsArrays/backgroundCards";
import bioCards from "./components/editor/cards/cardsArrays/bioCards";
import bioCardsAlt from "./components/editor/cards/cardsArrays/bioCardsAlt";
import contactCards from "./components/editor/cards/cardsArrays/contactCards";
import infoCards from "./components/editor/cards/cardsArrays/infoCards";
import serviceCards from "./components/editor/cards/cardsArrays/serviceCards";
import picCards from "./components/editor/cards/cardsArrays/picCards";
import picCardsAlt from "./components/editor/cards/cardsArrays/picCardsAlt";
import iconCards from "./components/editor/cards/cardsArrays/iconCards";
import priceCards from "./components/editor/cards/cardsArrays/priceCards";
import linkCards from "./components/editor/cards/cardsArrays/linkCards";
import faqCards from "./components/editor/cards/cardsArrays/faqCards";
import flipCards from "./components/editor/cards/cardsArrays/flipCards";
import blogCards from "./components/editor/cards/cardsArrays/blogCards";
// collages
import CollageArticle from "./components/editor/collages/CollageArticle";
// Images
import picture from "./components/editor/images/picture";
// Videos
import video from "./components/editor/video/video";
import videoArticle from "./components/editor/video/videoArticle";
// Statistics
import statistic from "./components/editor/statistics/statistic";
import statisticAlt from "./components/editor/statistics/statisticAlt";
// Statistics Array
import statistics from "./components/editor/statistics/statisticsArrays/statistics";
import statisticsAlt from "./components/editor/statistics/statisticsArrays/statisticsAlt";
// testimonials
import customerReview from "./components/editor/testimonials/customerReview";
import customerReviewAlt from "./components/editor/testimonials/customerReviewAlt";
import quote from "./components/editor/testimonials/quote";
// Testimonials Array
import customerReviews from "./components/editor/testimonials/testimonialsArray.js/customerReviews";
import customerReviewsAlt from "./components/editor/testimonials/testimonialsArray.js/customerReviewsAlt";
import quotes from "./components/editor/testimonials/testimonialsArray.js/quotes";
// Layout Imports
// Articles
import picArticle from "./components/layout/articles/picArticle";
import picArticleAlt from "./components/layout/articles/picArticleAlt";
// Banner
import banner from "./components/layout/banners/banner";
import infoBanner from "./components/layout/banners/infoBanner";
// Forms
import formMain from "./components/layout/forms/formMain";
import formAlt from "./components/layout/forms/formAlt";
import formPictureBackground from "./components/layout/forms/formPictureBackground";
// Heros
import heroMain from "./components/layout/heros/heroMain";
import heroAlt from "./components/layout/heros/heroAlt";
import heroText from "./components/layout/heros/heroText";
// Notifcations
import notifcationBar from "./components/layout/notifcations/notifcationBar";
import cookieConsent from "./components/layout/notifcations/cookieConsent";
// Premades
import picArticleFlip from "./components/layout/premade/picArticleFlip";
import pipArticle from "./components/layout/premade/pipArticle";
import sidebarArticle from "./components/layout/premade/sidebarArticle";
import articleImageGrid from "./components/layout/premade/articleImageGrid";
import statisticsArticleGrid from "./components/layout/premade/statisticsArticleGrid";
import normalPicArticle from "./components/layout/premade/normalPicArticle";
// Widgets
import miniForm from "./components/widgets/miniForm";
import sidebarContact from "./components/widgets/sidebarContact";

// Pricing
// -- Global Components--
// Headers
import headerMain from "./pages/headerFooter/headerMain";
// Footer
import footerMain from "./pages/headerFooter/footerMain";
// Theme
import brandColor from "./components/theme/brandColor";
import mainTheme from "./components/theme/mainTheme";
import fontOptions from "./components/theme/fontOptions";
import buttonTheme from "./components/theme/buttonTheme";

// Notifcations
// Ultilitys
import pic from "./components/ultilitys/pic";
import seo from "./components/ultilitys/seo";
import { socialArray, socialHandle } from "./components/ultilitys/socialHandle";
import editor from "./components/ultilitys/editor";
import simpleEditor from "./components/ultilitys/simpleEditor";
import layout from "./components/ultilitys/layout";
import basicEditor from "./components/ultilitys/basicEditor";
import linkOptions from "./components/ultilitys/linkOptions";
import youtube from "./components/ultilitys/youtube";
import map from "./components/ultilitys/map";
import {
  editorBulletList,
  bulletListHelper,
} from "./components/ultilitys/editorBulletList";
import {
  contactInfo,
  contactInfoArray,
} from "./components/ultilitys/contactInfo";
// Pages
import siteInfo from "./pages/siteSettings/siteInfo";
import siteTheme from "./pages/siteSettings/siteTheme";
import widgets from "./pages/siteSettings/widgets";
import index from "./pages/index";
import about from "./pages/about";
import contact from "./pages/contact";
import serviceMain from "./pages/serviceMain";
import usecases from "./pages/usecases";
import blog from "./pages/blog";
// Posts
import usecasePosts from "./pages/templates/usecasePosts";
import servicePosts from "./pages/templates/servicePosts";
import blogPosts from "./pages/templates/blogPosts";
import bioPosts from "./pages/templates/bioPosts";
import customPage from "./pages/templates/customPage";

// Theme Pages
// Buttons
import altButtonTheme from "./pages/siteSettings/componentThemes/buttons/altButtonTheme";
import cardButtonTheme from "./pages/siteSettings/componentThemes/buttons/cardButtonTheme";
import heroButtonTheme from "./pages/siteSettings/componentThemes/buttons/heroButtonTheme";
import mainButtonTheme from "./pages/siteSettings/componentThemes/buttons/mainButtonTheme";
import submitButtonTheme from "./pages/siteSettings/componentThemes/buttons/submitButtonTheme";
// Cards
import backgroundCardTheme from "./pages/siteSettings/componentThemes/cards/backgroundCardTheme";
import bioCardAltTheme from "./pages/siteSettings/componentThemes/cards/bioCardAltTheme";
import bioCardTheme from "./pages/siteSettings/componentThemes/cards/bioCardTheme";
import contactCardTheme from "./pages/siteSettings/componentThemes/cards/contactCardTheme";
import iconCardTheme from "./pages/siteSettings/componentThemes/cards/iconCardTheme";
import infoCardTheme from "./pages/siteSettings/componentThemes/cards/infoCardTheme";
import picCardAltTheme from "./pages/siteSettings/componentThemes/cards/picCardAltTheme";
import picCardTheme from "./pages/siteSettings/componentThemes/cards/picCardTheme";
import serviceCardTheme from "./pages/siteSettings/componentThemes/cards/serviceCardTheme";
import priceCardTheme from "./pages/siteSettings/componentThemes/cards/priceCardTheme";
import linkCardTheme from "./pages/siteSettings/componentThemes/cards/linkCardTheme";
import faqCardTheme from "./pages/siteSettings/componentThemes/cards/faqCardTheme";
import flipCardTheme from "./pages/siteSettings/componentThemes/cards/flipCardTheme";
import blogCardTheme from "./pages/siteSettings/componentThemes/cards/blogCardTheme";
// Pics

// Collages
import picCollageTheme from "./pages/siteSettings/componentThemes/collages/picCollageTheme";
// Statistics
import statisticsAltTheme from "./pages/siteSettings/componentThemes/statistics/statisticsAltTheme";
import statisticsMainTheme from "./pages/siteSettings/componentThemes/statistics/statisticsMainTheme";
// Testimonials
import customerReviewAltTheme from "./pages/siteSettings/componentThemes/testimonials/customerReviewAltTheme";
import customerReviewTheme from "./pages/siteSettings/componentThemes/testimonials/customerReviewTheme";
import quotesTheme from "./pages/siteSettings/componentThemes/testimonials/quotesTheme";
// Editor Themes
// Videos
import videoArticleTheme from "./pages/siteSettings/componentThemes/videos/videoArticleTheme";
// Ecom Section ------------
// Components
import collectionRule from "./components/ecom/collectionRule";
import shopifyCollection from "./components/ecom/shopifyCollection";
import shopifyProudct from "./components/ecom/shopifyCollection";
import shopifyProudctVariant from "./components/ecom/shopifyProductVariant";

// Inputs
// import CollectionHidden from "./components/ecom/inputs/CollectionHidden";
// import PlaceholderString from "./components/ecom/inputs/PlaceholderString";
// import ProductHidden from "./components/ecom/inputs/ProductHidden";
// import ProductVariantHidden from "./components/ecom/inputs/ProductVariantHidden";
// import ProxyString from "./components/ecom/inputs/ProxyString";

// pages
import collection from "./pages/ecom/collection";
import proudct from "./pages/ecom/product";
import productVariant from "./pages/ecom/productVariant";
Jan 4, 2023, 8:05 PM
export default [
  /* Your types here! */
  buttonMain,
  buttonAlt,
  buttonHero,
  buttonIcon,
  buttonSubmit,
  video,
  videoArticle,
  buttonCard,
  backgroundCard,
  bioCard,
  bioCardAlt,
  iconCard,
  picCard,
  picCardAlt,
  contactCard,
  infoCard,
  serviceCard,
  linkOptions,
  CollageArticle,
  picArticle,
  picArticleAlt,
  faqCard,
  picture,
  flipCard,
  flipCards,
  statistic,
  statisticAlt,
  statistics,
  statisticsAlt,
  customerReview,
  customerReviewAlt,
  quote,
  youtube,
  normalPicArticle,
  bulletListHelper,
  editorBulletList,
  contactInfo,
  contactInfoArray,
  statisticsArticleGrid,
  customerReviews,
  priceCard,
  customerReviewsAlt,
  cookieConsent,
  quotes,
  banner,
  infoBanner,
  formMain,
  formAlt,
  miniForm,
  formPictureBackground,
  footerMain,
  headerMain,
  sidebarArticle,
  sidebarContact,
  articleImageGrid,
  heroMain,
  heroAlt,
  heroText,
  notifcationBar,
  picArticleFlip,
  pic,
  seo,
  socialHandle,
  socialArray,
  siteInfo,
  siteTheme,
  priceCardTheme,
  widgets,
  editor,
  map,
  layout,
  mainTheme,
  index,
  basicEditor,
  simpleEditor,
  serviceMain,
  about,
  contact,
  blog,
  usecases,
  usecasePosts,
  servicePosts,
  customPage,
  blogPosts,
  bioPosts,
  backgroundCards,
  bioCards,
  blogCard,
  blogCards,
  bioCardsAlt,
  contactCards,
  iconCards,
  infoCards,
  priceCards,
  linkCard,
  picCards,
  picCardsAlt,
  serviceCards,
  faqCards,
  linkCards,
  pipArticle,
  altButtonTheme,
  cardButtonTheme,
  heroButtonTheme,
  mainButtonTheme,
  submitButtonTheme,
  backgroundCardTheme,
  bioCardAltTheme,
  bioCardTheme,
  blogCardTheme,
  contactCardTheme,
  iconCardTheme,
  infoCardTheme,
  picCardAltTheme,
  picCardTheme,
  flipCardTheme,
  serviceCardTheme,
  linkCardTheme,
  picCollageTheme,
  statisticsMainTheme,
  statisticsAltTheme,
  customerReviewAltTheme,
  customerReviewTheme,
  quotesTheme,
  videoArticleTheme,
  faqCardTheme,
  brandColor,
  fontOptions,
  buttonTheme,
  collection,
  collectionRule,
  shopifyCollection,
  product,
  shopifyProudct,
  productVariant,
  shopifyProudctVariant,
];
Jan 4, 2023, 8:05 PM
Looks like you've got a typo in your import!
import proudct from "./pages/ecom/product";
Jan 4, 2023, 8:12 PM
thank you!!I have this funny error now. I copied the product page from the shopify starter. Its structured alot differently than normal. Do you think that could be the issue?
Jan 4, 2023, 8:17 PM
Hmmm, can you share your
./pages/ecom/product.js
file?
Jan 4, 2023, 8:18 PM
Can i pm you my repo
Jan 4, 2023, 8:20 PM
Sounds good!
Jan 4, 2023, 8:22 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?