Fresh build of Sage dev-master failing with StyleLint error

I just used composer create-project roots/sage five dev-master to install Sage - with no framework.

The build is failing. I’ve used it so many times in the past with no issues, but I can’t get this one to work. Has something changed recently?

Seeing this when I run yarn start:

Invalid Option: Unexpected option value "[object Object]" for rule "at-rule-no-unknown"

yarn build is yielding this:

Error: Failed because of a stylelint error

at linter.then (/Library/WebServer/Documents/base/wp5/wp- 
content/themes/five/node_modules/stylelint-webpack-plugin/lib/run-compilation.js:39:14)
error Command failed with exit code 1.

Anyone else seen this? Any ideas gratefully received.

dev-master is not 9.0.5 FYI. Hopefully master isn’t broken! :smiley:

yarn lint should show the specific error (also shown in console/on screen during BrowserSync session)

1 Like

Yes, I already mentioned the specific error.

I have commented out everything from main.scss and main.js and it’s still not happy - won’t build. This is the first time I’ve had Sage fail to build.

Cool. Thanks! It looks like master is broken right now. Please use 9.0.5 or other previous releases for a working build.

Thanks for the swift reply. Hope it’s an easy fix :slight_smile:

I can confirm that:

composer create-project roots/sage five 9.0.5 worked perfectly and there are no build issues.

We’re working on a fix for this, but at the moment the workaround is just opening up package.json after you install from dev-master and removing this from the bottom:

"stylelint": {
  "rules": {
    "at-rule-no-unknown": {
      "1": {
        "ignoreAtRules": null
      }
    }
  }
}

This is resolved. Thanks for reporting, @raffjones!

Related: https://github.com/roots/sage/pull/2131

3 Likes

Thanks for that quick response, @mmirus. It’s all working sweetly now.

1 Like

My apologies if it’s not correct protocol to bump old and resolved threads, but I didn’t want to create another thread with an almost exact issue.

I ran yarn build and got this error:

yarn run v1.16.0

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

Error: Failed because of a stylelint error.

at linter.then (/var/www/companyname.com/wordpress/wp-content/themes/companyname/node_modules/stylelint-webpack-plugin/lib/run-compilation.js:39:14)

error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Is the fix still to remove the following from the bottom of package.json?

“stylelint”: {
“rules”: {
“at-rule-no-unknown”: {
“1”: {
“ignoreAtRules”: null
}
}
}
}

I didn’t install from dev-master, I just ran composer create-project roots/sage your-theme-name

1 Like

I’m having the exact same issue with Yarn Build. also running webpack --progress --config and then failes at linter.then.

should mention my error occurs same line, same character.

Hi @Kevin_Malone,

I ran:

yarn run lint:styles

And I got back a detailed error and was able to fix it.

In my case, in the _variables.scss file, there was an error in how I was writing the primary color hex code and I needed an extra blank line at the end of the entire file.

Hope this helps.

Kind regards,

Steve

1 Like

Indeed, I reached the same solution after some digging. Good stuff. Thanks bud.