Imported image src not being prepended with public directory path

Hello Frontity,

I’m trying to update Frontity to the latest version but i’m running into an issue.

On initial load, all the images that are imported into components are missing. After looking into it further, it looks like the srcs for the images are not being prepended with the public directory path.

However, when the page hot reloads or is rendered client side, the images appear with the correct path.

Below is a link to a very basic theme demonstrating the issue, but this can also be replicated in the Mars theme.

https://we.tl/t-FN4d21Y4vO

import image from '../static/test.png';

const Theme = () => <img src={image} alt="Not loading from server package." />

export default Theme;

Image src on initial load: images/test.png

Expected src (and rendered correctly client side): /static/images/test.png

Kind regards,

Jack

1 Like

Has anyone been able to replicate this issue?

Hi @jack.templeman.user1, its a bug from the latest version of frontity.

I just reported it here:

and here:

1 Like

Thanks for the update @Hussein. Glad its not just me!

Any updates on this issue?

A fix of this problem is discussed here: Frontity release: Dynamic Public Path - #6 by luisherranz