Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module not found for background image #1491

Open
adaksuman opened this issue Mar 28, 2019 · 2 comments
Open

module not found for background image #1491

adaksuman opened this issue Mar 28, 2019 · 2 comments

Comments

@adaksuman
Copy link

Hi all,

I have a custom css file which I have placed in assets/css folder. Now inside of this css file, I have referred some images which are placed inside assets/images folder. I did css loading in main.js using require. Like require('./assets/css/custom.css). It does successfully loaded but when I refer a background images in custom.css like
background: transparent url('./assets/images/home.png') 50% 50% no-repeat; it fails and says that module is not found.

Could someone please help me what is wrong with this?
I did install vue-loader, css-loader and style-loader and project is created with vue-cli.

Also along with this my custom.css file is required throughout my application. What could be best place to put in. Will it be in main.js or App.vue ?

@adaksuman
Copy link
Author

error was throwing in my console is
These relative modules were not found:

  • ./assets/images/ajax-loader1.gif in ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/css/custom.css
  • ./assets/images/custom/danger.png in ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/css/custom.css

@ajaymarathe
Copy link

Same error I have when using gull Theme -
* ../../Image/Header_Bg_1.png in ./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/styles/css/themes/lite-purple.min.css

  • any solution ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants