Category : laravel-mix

my class from variable is not working, im sure its mix problem. <div class="rounded bg-gradient-to-r {{$replay->playerOneTeam()}}"> Team: {{ $replay->playerOneTeam()}} </div> It seems like purgeCSS or something is removing class "from-red-400". When I set it manually and do npm run dev it works, but when it’s used from variable, it’s not loading. The class is in ..

Read more

below is my config in webpack.mix.js const mix = require(‘laravel-mix’); require(‘laravel-mix-svelte’); mix.js(‘resources/js/app.js’, ‘public/js’) .sass(‘resources/sass/app.scss’, ‘public/css’).svelte(); below is my config in package.json { "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js –progress –config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development — –watch", "watch-poll": "npm run watch — –watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js –inline –hot –disable-host-check ..

Read more

I am working on a Laravel project which is hosted on Heroko. A few days ago it stop building and produced the following error message ℹ Compiling Mix [webpack-cli] [Error: ENOENT: no such file or directory, open ‘/tmp/src/js/vendors/plugins/datatables.init.js’] { errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘/tmp/src/js/vendors/plugins/datatables.init.js’ } npm ERR! code ELIFECYCLE npm ERR! errno ..

Read more

I’m using laravel-mix in Laravel8 to write react code and compile then. In normal use everything is right. but when I want to load an mp4 file into react using line below: require(`./files/${mp4file}`) I receive this error for loading mp4 file during compile with laravel-mix by npm run dev: ERROR in ./resources/files/5.mp4 1:0 Module parse ..

Read more

Im at a loss at what can be causing this issue, I know it has to do with me using the Laravel component syntax because when i change my component from a Livewire component which was working fine but I just wasn’t using it for anything that needs Livewire for, to a Laravel component it ..

Read more

I’m writing a program using laravel. To manage css and js, I used versioning and call it with a function like this <link rel="stylesheet" href="{{ mix(‘/css/app.css’) }}"> The code above produces html output as follows <link rel="stylesheet" href="/css/app.css?id=53a226b301fc510ddf79"> When I upload to hosting, why does the above code only produce html like this ? <link ..

Read more

Laravel Mix Version: #.#.# (6.0) Node Version (v14.18.0): NPM Version (6.14.15): OS: windwos 11 Description: error ERROR in ./resources/sass/variables.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: expected "{". ╷ 4 │ var content = require("!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./variables.scss"); │ ^ ╵ resourcessassvariables.scss 4:129 root stylesheet webpack.config.js module: { rules: [ { test: /.template$/, ..

Read more

I’m using laravel mix to build and complie my front-end files, and trying to share variables between scss file and js, here is my scss file and app.js file. variables.scss $color: ‘#ffffff’; :export{ color: $color } app.js import variables from ‘./variables.scss’ console.log(variables) It should print an object {color: ‘#ffffff’} defined in variables.scss file. But instead ..

Read more

I would like to know how can I use APP_URL from my env in the layout. Currently, I have this in my layout : <!– Styles –> <link rel="stylesheet" href="{{ asset(mix(‘css/styles.css’)) }}"> <!– Javascript –> <script src="{{mix(‘js/app.js’)}}"></script> In my webpack.mix.js : const mix = require(‘laravel-mix’); const tailwindcss = require(‘tailwindcss’); // Styles mix.sass(‘resources/scss/styles.scss’, ‘public/css’) .options({ postCss: ..

Read more

This is using docker. It works when using wsl2 but when using hyper-v I’m getting the issue. I’m trying to run mix watch — –watch-options-poll=3000 or mix –production but every time I’m running it I’m getting the following issue: [webpack-cli] [Error: EEXIST: file already exists, open ‘/var/www/html/public/website/images/e-side.png’] { errno: -17, code: ‘EEXIST’, syscall: ‘open’, path: ..

Read more

I am in the process of integrating Metronic 8 with Laravel 8. I have followed the guide from Metronic in their documentation but when I run npm run dev it webmix gets to 98% and then fails with the following output: ERROR in ./resources/src/sass/style.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): ..

Read more