Image not displayed in reactjs vercel deployment - Stack Overflow

I'm about to deploy a website, and I discover the error message belowI tried moving the image from

I'm about to deploy a website, and I discover the error message below

I tried moving the image from my assets folder to my public folder and redeploying.
I also tried importing it from the images folder and adding it as jsx.
But none worked
This is my current folder structure

This is the code using the background. Works locally, but not in deployment

import React from "react";
import Loader from "./StyledHeader";

const HeroHeader = () => {


  return (
    <div>
      <div className="hero-img">
        <img src= "public/images/pasta-image.jpg" alt="" />

        <div className="hero-text">
          <h1>Checkout</h1>
          <Loader />
          <h1>Recipes</h1>
        </div>
      </div>
    </div>
  );
};

export default HeroHeader;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744842381a4596635.html

相关推荐

  • Image not displayed in reactjs vercel deployment - Stack Overflow

    I'm about to deploy a website, and I discover the error message belowI tried moving the image from

    2天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信