1

The real deal is that I’m learning webpack and trying to create my own vue template but I’m getting this issue that not happens in webpack-simple or others templates, and my config for images is pretty similar to what is normally used by templates.

{ test: /\.(png|jpe?g|gif)$/i, use: { loader: 'file-loader', options: { name: '[name].[ext]', outputPath: './assets/', }, }, } 

I got the following error

http://localhost:8080/[object%20Module] 404 (Not Found)

When I try to get the logo in App.vue

<template> <img src="./assets/logo.png"/> </template> 

A fact is that when I use his “dependency” name or hash given by webpack the image is called right.

But the vue docs say that calling as I do has to work as work like in webpack-simple template since the call will be parsed by the webpack.

I don’t know if it helps, but I can import the img from path with import img from './assets/logo.png' just with the HTML in template that I get this problem.

2
  • Does it help to use <img src="~./assets/logo.png"/>? Commented Dec 13, 2019 at 17:20
  • No, same error :/ Commented Dec 13, 2019 at 20:26

1 Answer 1

1

solved with this workaround, just disable esModule in file-loader

https://github.com/vuejs/vue-loader/issues/1612

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.