adrianhajdin / ecommerce_sanity_stripe

Modern Full Stack ECommerce Application with Stripe
https://jsmastery.pro
2.21k stars 674 forks source link

sanity schema problem #93

Open chaima-elm opened 1 year ago

chaima-elm commented 1 year ago

i get this error in sanity when exporting schemas: SyntaxError: The requested module '/node_modules/.sanity/vite/deps/sanity.js?v=437cca74' does not provide an export named 'default' image

Artemushek commented 1 year ago

write this:

import product from './product' import banner from './banner'

export const schemaTypes = [ product, banner ]

vaibhavkrsi commented 1 year ago

Here is what I did covert index.js to index.ts write the code of @Artemushek it solved my error.

import banner from './banner' import product from './product'

export const schemaTypes = [banner,product]

peanutsee commented 1 year ago
import product from './product';
import banner from './banner';

export const schemaTypes = [product, banner];

Solution adapted from https://www.sanity.io/docs/create-a-schema-and-configure-sanity-studio