Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ruben777's avatar

can't display png

I am working on Laravel and Inertia. I have some trouble displaying a png that I want to use as a logo.

I wrote this in ApplicationMark.vue :

<template>
        <img :src="logo" alt="logo"/>
</template>

<script>
import logo from "public/img/logo_monsitevabien.png";
export default {
    data() {
        return {
            logo: logo,
        }
    }
}
</script>

and then import it in AppLayout.vue :

import JetApplicationMark from '@/Jetstream/ApplicationMark.vue';

<Link :href="route('dashboard')">
    <JetApplicationMark class="block h-9 w-auto" />
</Link>

and here is the error that I get in console :

Uncaught (in promise) Error: Cannot find module 'public/img/logo_monsitevabien.png'

I have tried to change location and path of the image mutliple times. always same error occurs.

does anyone has an idea ?

edit I also have tried this way :

<template>
    <img src="public/img/logo_monsitevabien.png" alt="logo"/>
</template>

<script setup>
import { Link } from '@inertiajs/inertia-vue3';
export default {
}
</script>
0 likes
4 replies
Sergiu17's avatar
<template>
        <img src="/img/logo_monsitevabien.png" alt="logo"/>
</template>
ruben777's avatar

@Sergiu17 thank you for your answer. doing this way throws me a 404 page not found :

GET https://website.fr/img/logo_monsitevabien.png

I can see the alternative text "logo" though. guess this is some progress

huyvuong's avatar
<img :src="'/images/user.svg'" style="width: 36px">

I did this in my project(use Vue and Inertia too) images is inside public folder

Please or to participate in this conversation.