Tengo un problema al importar los estilos con sass


Topic: Tengo un problema al importar los estilos con sass

alex_hernandez asked 5 years ago

Expected behavior Me deveria cargar las imagenes, de node_modules del paquete de mdbreactt

Uso react en el frontend, con webpack y django en el backend y el error que me sale es que Can't resolve '../img/svg/arrow_right.svg', esto deve pasar porque solo lo resolveria con una ruta absoluta, creo yo pero no se como arreglarlo, Gracias

Actual behavior Los estilos los importa pero las imágenes no

Resources (screenshots, code snippets etc.) Me salen estos errores ERROR in ./cride/frontend/static/assets/styles/styles.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./cride/frontend/static/assets/styles/styles.scss) Module not found: Error: Can't resolve '../img/svg/arrow_right.svg' in 'C:\Users\vlexh\cride\cride\frontend\static\assets\styles' @ ./cride/frontend/static/assets/styles/styles.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./cride/frontend/static/assets/styles/styles.scss) 14:37-74 @ ./cride/frontend/static/assets/styles/styles.scss @ ./cride/frontend/src/index.js


Piotr Glejzer staff answered 5 years ago

Hi,

You didn't use English but I probably understood where it is a problem.

In scss/core/_variable.scss you have a variable $image-path to arrow-left and right in the carousel component. You have to change that variable to your correct path.

Best regards,
Piotr


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.25.2
  • Device: PC
  • Browser: Google chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No
Tags