Git Product home page Git Product logo

Comments (9)

sodapopjam avatar sodapopjam commented on May 21, 2024 1

Line 23 should say: https://codefile.io/f/O2jutdM2wO62ZiApBPcT

170246595-b1e13a57-a2d7-49da-8b45-878a3d205405
{

from ecommerce_sanity_stripe.

miahthegreat avatar miahthegreat commented on May 21, 2024

@pradapdp7

The error you are getting appears to be stemming from the Product.jsx file within the components folder, not the [slug].js file. What does your Product.jsx look like?

from ecommerce_sanity_stripe.

pradapdp7 avatar pradapdp7 commented on May 21, 2024

@pradapdp7

The error you are getting appears to be stemming from the Product.jsx file within the components folder, not the [slug].js file. What does your Product.jsx look like?
Screenshot (84)
this is my product.jsx file sir

from ecommerce_sanity_stripe.

pradapdp7 avatar pradapdp7 commented on May 21, 2024

@pradapdp7

The error you are getting appears to be stemming from the Product.jsx file within the components folder, not the [slug].js file. What does your Product.jsx look like?

here, the home page works fine but when i click any product this error pops up

from ecommerce_sanity_stripe.

sodapopjam avatar sodapopjam commented on May 21, 2024

No, the error is on slug page. I can't see above params: on the first screenshot, but it says you're missing a ,
Make sure the line above params on [slug].js ends with a comma ,

from ecommerce_sanity_stripe.

pradapdp7 avatar pradapdp7 commented on May 21, 2024

No, the error is on slug page. I can't see above params: on the first screenshot, but it says you're missing a , Make sure the line above params on [slug].js ends with a comma ,
Screenshot (89)

this is my code above params. can you tell me what to change

from ecommerce_sanity_stripe.

pradapdp7 avatar pradapdp7 commented on May 21, 2024

Line 23 should say: https://codefile.io/f/O2jutdM2wO62ZiApBPcT

![170246595-b1e13a57-a2d7-49da-8b45-878a3d205405](https://user-images.githubusercontent.com/69822895/170260368-c2ec91ae-5935-451c-8c50-09
Screenshot (90)
cf9f8dcdfc.png) {

thankyou so much but after clearing that I got this error.kindly help me :(. Again Thanks in advance:)

from ecommerce_sanity_stripe.

sodapopjam avatar sodapopjam commented on May 21, 2024

That's great!
The new error seems to be that slug should be all lowecase :)

slug: product.slug.current

from ecommerce_sanity_stripe.

vaniadimova avatar vaniadimova commented on May 21, 2024

I am stuck on TypeError: Cannot destructure property 'image' of 'product' as it is null. clicking on the button /// when clicking on the product it works ... my brain got scrambled pls help, pretty please.

export const getStaticPaths = async () => {
const query = *[_type == "product"] { slug { current } }
const products = await client.fetch(query);
const paths = products.map((product) => ({
params: {
slug: product.slug.current
}
}));

return {
paths,
fallback: 'blocking'
}
}

export const getStaticProps = async ({ params: { slug }}) => {
const query = *[_type == "product" && slug.current == '${slug}'][0];
const product = await client.fetch(query);

const productsQuery = '*[_type == "product"]'
const products = await client.fetch(productsQuery);

return {
props: { products, product }
}
}

from ecommerce_sanity_stripe.

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.