Обновлен Laravel Mix до 4.0.16 и теперь появляется ошибка «Невозможно прочитать свойство sassLoader of undefined» - PullRequest
0 голосов
/ 13 июня 2019

Я недавно начал новый проект и использую последнюю версию Laravel Mix: 4.0.16. Мой старый проект, использующий 4.0.15, работает нормально, но новая версия не работает вообще.

Версия узла: 8.11.4
Версия NPM: 6.4.1

Я также включил свой файл package.json и файл webpack.

ERROR in ./src/themes/default.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from C:/Users/PaigeJones/node_modules/sass-loader/index.js):
TypeError: Cannot read property 'sassLoader' of undefined
    at getLoaderConfig (C:\Users\PaigeJones\node_modules\sass-loader\index.js:389:39)
    at Object.module.exports (C:\Users\PaigeJones\node_modules\sass-loader\index.js:42:23)
    at runLoaders (C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\webpack\lib\NormalModule.js:302:20)
    at C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\loader-runner\lib\LoaderRunner.js:143:3)
    at iterateNormalLoaders (C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\loader-runner\lib\LoaderRunner.js:205:4
    at process.nextTick (C:\Users\PaigeJones\Desktop\paigejones.me\archwardens\static\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:73:15)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
 @ ./src/themes/default.scss

ERROR in ./src/themes/default.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!C:/Users/PaigeJones/node_modules/resolve-url-loader??ref--5-4!C:/Users/PaigeJones/node_modules/sass-loader??ref--5-5!./src/themes/default.scss)
Module build failed (from C:/Users/PaigeJones/node_modules/sass-loader/index.js):
TypeError: Cannot read property 'sassLoader' of undefined
    at getLoaderConfig (C:\Users\PaigeJones\node_modules\sass-loader\index.js:389:39)
    at Object.module.exports (C:\Users\PaigeJones\node_modules\sass-loader\index.js:42:23)
 @ ./src/themes/default.scss 2:14-278
{
  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "cross-env": "^5.2.0",
    "laravel-mix": "^4.0.16"
  }
}
const mix = require('laravel-mix')
mix.setPublicPath('public')
mix.disableNotifications()

/**
 * Mix the javascript for the game.
 */
mix.js('src/js/app.js', 'public/js/app.js').version()

/**
 * Mix the stylesheets for the game.
 */
mix.sass('src/themes/default.scss', 'public/css/default.css', {
  implementation: require('node-sass')
}).version()
...