SolomonRei
2 months ago
357
1
Mix

React issue (css-loader)

Posted 2 months ago by SolomonRei

Goodnight! I've never implemented react in laravel. I've got any issues and don't know how resolve them.

App.js

require('./bootstrap');
import './App.css';
import React from 'react';
import { Button } from 'react-bootstrap';
import '../sass/style.scss';
import Footer from './components/Footer/';
import Header from './components/Header';
import Content from './components/Pages/main/Content';
import AboutPage from './components/Pages/About/';
import PartnersPage from './components/Pages/Partners/';
import VacantionPage from './components/Pages/Vacantion/';
import { BrowserRouter, Route } from 'react-router-dom';
import ListingsPage from './components/Pages/Listings';
import ListingPage from './components/Pages/Listing';
import newPage from './components/Pages/newPage';
import RealtyPage from './components/Pages/Realty/';

App.sass

// Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito');

// Variables
@import 'variables';

// Bootstrap
@import '~bootstrap/scss/bootstrap';

webpack.mix.js

const mix = require('laravel-mix');
mix.react('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');

Error

ERROR in ./resources/js/components/Pages/main/Services/style.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./resources/js/components/Pages/main/Services/style.scss)

Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Can't resolve '/img/about/background.svg' in 
'W:\domains\imobil\resources\js\components\Pages\main\Services'

Error: Can't resolve '/img/about/background.svg' in 
'W:\domains\imobil\resources\js\components\Pages\main\Services'
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:209:21
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:44:7
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:67:43
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:16:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:16:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:16:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\Resolver.js:285:5
at eval (eval at create (W:\domains\imobil\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at W:\domains\imobil\node_modules\enhanced-resolve\lib\DirectoryExistsPlugin.js:27:15
at W:\domains\imobil\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:85:15
at processTicksAndRejections (internal/process/task_queues.js:75:11)
 @ ./resources/js/components/Pages/main/Services/style.scss 2:26-239
 @ ./resources/js/components/Pages/main/Services/index.js
 @ ./resources/js/components/Pages/main/Content.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/sass/app.scss

ERROR in ./resources/js/components/Pages/Banner/style.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./resources/js/components/Pages/Banner/style.scss)

Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Can't resolve '/img/cities-chat.png' in 'W:\domains\imobil\resources\js\components\Pages\Banner'
....

Please sign in or create an account to participate in this conversation.