2

Images are local svg files. I've tried having them in /Public and in /src (they're in src currently). As the title states, these images load fine when I run the app locally with a yarn start. But do not load when I push my build files to Amplify.

The site is nhlstats.me. There should be an image at the top and an image at the bottom. Here is the code for the image at the top:

import React from 'react'
import player_me from './player_me.svg'
import net_blue_me from './net_blue_me.svg'
import './banner.css'

class Header extends React.Component {
    
    render() {
        return (<img src={net_blue_me} class='banner' />);
    }
}

export default Header;

Here's how the site looks when I run it locally vs. Amplify:

https://i.stack.imgur.com/CrcGQ.jpg

Finally, the inspector just tells me that the image could not be loaded.

Any help is greatly appreciated.

2 Answers2

0

In my case, AWS Amplify was not playing nice with SVG images. Changed them to PNG and the issue was resolved.

0

Check the answers here: Link.
I think that might help, especially the one regarding HTTPS.

urirot
  • 279
  • 1
  • 10