ecommerce_sanity_stripe icon indicating copy to clipboard operation
ecommerce_sanity_stripe copied to clipboard

sanity schema problem

Open chaima-elm opened this issue 2 years ago • 3 comments

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

chaima-elm avatar Jan 06 '23 22:01 chaima-elm

write this:

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

export const schemaTypes = [ product, banner ]

Artemushek avatar Jan 27 '23 17:01 Artemushek

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]

vaibhavkrsi avatar Apr 09 '23 10:04 vaibhavkrsi

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

peanutsee avatar Aug 09 '23 04:08 peanutsee