2

When I try to run Sage 9.0.10 in my Wordpress 5.5.3 theme and install Yarn and then do "yarn build" or "yarn start" I get this error:

PS C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep> yarn build
yarn run v1.22.5

$ webpack --progress --config resources/assets/build/webpack.config.js

Error: No files matching the pattern "C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep\resources\assets\**\*.s?(c|a)ss" were found.
    at C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep\node_modules\stylelint\lib\standalone.js:212:12
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep>

With "build" and "start" always I get

Error: No files matching the pattern "C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep\resources\assets\**\*.s?(c|a)ss"

and I can't find what went wrong, because it used to work before I had to nuke my whole installment of Wordpress and Sage. After reinstalling this happens.

Samuel Lelièvre
  • 3,212
  • 1
  • 14
  • 27
Pat
  • 21
  • 1
  • 5

3 Answers3

23

I had the same issue, i've updated only 3 dev dependeinces . i took them from sage 9.0.9 so i updated

"stylelint": "^13.7.2",
"stylelint-config-standard": "^20.0.0",
"stylelint-webpack-plugin": "^0.10.5",

to

"stylelint": "^8.4.0",
"stylelint-config-standard": "~18.2.0",
"stylelint-webpack-plugin": "^0.10.5",

of course removed old node_modules folder, and launched yarn. works like a charm.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Danylo
  • 231
  • 1
  • 2
10

Ran into the same problem and couldn't find an answer for weeks. There is a problem with the StyleLintPlugin. What have I done is this:

  • Open webpack.config.js file in theme-name/resources/assets/build
  • Ctrl + F for "StyleLintPlugin"
  • Comment out this section of code

new StyleLintPlugin({
  failOnError: !config.enabled.watcher,
  syntax: "scss",
})

I don't think that this is the best option, but it worked for me. If anyone else has a better one, please let us know.

Dharman
  • 30,962
  • 25
  • 85
  • 135
1

This happened to me also with the latest version of Sage. Could not get it running no matter what. Ended up using these older dependencies in my package.json:

"devDependencies": {
    "autoprefixer": "~8.2.0",
    "browser-sync": "~2.24.7",
    "browsersync-webpack-plugin": "^0.6.0",
    "bs-html-injector": "~3.0",
    "buble-loader": "^0.4.1",
    "cache-loader": "~1.2.5",
    "clean-webpack-plugin": "^0.1.18",
    "copy-globs-webpack-plugin": "^0.2.0",
    "cross-env": "^7.0.2",
    "css-loader": "^0.28.9",
    "cssnano": "~4.0.5",
    "eslint": "~4.19.1",
    "eslint-loader": "~1.9",
    "eslint-plugin-import": "~2.14.0",
    "extract-text-webpack-plugin": "~3.0.2",
    "file-loader": "^1.1.6",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "imagemin-mozjpeg": "~7.0.0",
    "imagemin-webpack-plugin": "~2.2.0",
    "import-glob": "~1.5",
    "node-sass": "~4.9.4",
    "postcss-loader": "~2.1.0",
    "postcss-safe-parser": "~3.0",
    "resolve-url-loader": "~2.3.1",
    "rimraf": "~2.6",
    "sass-loader": "~6.0",
    "style-loader": "^0.22.1",
    "stylelint": "^8.4.0",
    "stylelint-config-standard": "~18.2.0",
    "stylelint-webpack-plugin": "^0.10.5",
    "uglifyjs-webpack-plugin": "^1.3.0",
    "url-loader": "^0.6.2",
    "webpack": "~3.10.0",
    "webpack-assets-manifest": "^1.0.0",
    "webpack-dev-middleware": "~2.0.4",
    "webpack-hot-middleware": "~2.22.3",
    "webpack-merge": "~4.1.4",
    "yargs": "~11.0.0"
  },

Used node version 8.11.3, then performed clean install so

  • remove package-lock.json
  • remove node_modules
  • then npm install

then it finally worked!

In case you are running on windows and get error Python2 not found in PATH,

  • open powershell with administrative rights
  • run npm install --global windows-build-tools (it will install python easily)
  • then repeat the process above

Good luck mate!