-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Class extends value undefined is not a constructor or null #5
Comments
same for me, any suggestion? 😕 |
I have the same issue |
Can you provide minimal reproducible test case? |
@niksy I tried to post that in my original comment. Is there something else you would like to see? |
@ayjee we need whole directory and package structure so we’re sure there isn’t any conflicting dependencies and things like that. |
@niksy are there any known conflicting dependencies? I'm having the same issue as well. |
Of course. Developing dependencies:
Main dependencies:
.stylelintrc:
That's all, to be true. I was impressed, because it is the most standard setup I can imagine. I was thinking about |
This is related to how npm installs and flattens dependencies. Here are possible fixes:
|
This seems to fix it for me @niksy. Thanks so much! |
@niksy Thank you
|
@niksy Thank you. You saved me so much time! |
@niksy thanks for this -- I encountered this while upgrading stylelint and the error message is supremely non-obvious! Slight variation in my situation: bit monorepo, and there are various dependencies at various levels some of which pull in postcss v7 and some v8, and lerna was hosting the v7 as chance would have it. Adding postcss@8 to the top-level package.json resolves. Many thanks. |
…es/5 config change prettier
`postcss-scss` expects `postcss@8`, this therefore caused the error `TypeError: Class extends value undefined is not a constructor or null` when running Stylelint see: stylelint-scss/stylelint-config-standard-scss#5 (comment)
stylelint-config-gds includes postcss-scss, this expects postcss as peer depdendency, by default, other dependencies use the wrong version. Needed to install as dependency so that the correct version is available. More info here: stylelint-scss/stylelint-config-standard-scss#5
stylelint-config-gds includes postcss-scss, this expects postcss as peer depdendency, by default, other dependencies use the wrong version. Needed to install as dependency so that the correct version is available. More info here: stylelint-scss/stylelint-config-standard-scss#5
* Bump stylelint, stylelint-config-gds and stylelint-order Bumps [stylelint](https://github.com/stylelint/stylelint), [stylelint-config-gds](https://github.com/alphagov/stylelint-config-gds) and [stylelint-order](https://github.com/hudochenkov/stylelint-order). These dependencies needed to be updated together. Updates `stylelint` from 13.13.1 to 14.6.1 - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](stylelint/stylelint@13.13.1...14.6.1) Updates `stylelint-config-gds` from 0.1.0 to 0.2.0 - [Release notes](https://github.com/alphagov/stylelint-config-gds/releases) - [Changelog](https://github.com/alphagov/stylelint-config-gds/blob/main/CHANGELOG.md) - [Commits](alphagov/stylelint-config-gds@0.1.0...0.2.0) Updates `stylelint-order` from 4.1.0 to 5.0.0 - [Release notes](https://github.com/hudochenkov/stylelint-order/releases) - [Changelog](https://github.com/hudochenkov/stylelint-order/blob/master/CHANGELOG.md) - [Commits](hudochenkov/stylelint-order@4.1.0...5.0.0) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-major - dependency-name: stylelint-config-gds dependency-type: direct:development update-type: version-update:semver-minor - dependency-name: stylelint-order dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Explicitly add postcss to dependencies stylelint-config-gds includes postcss-scss, this expects postcss as peer depdendency, by default, other dependencies use the wrong version. Needed to install as dependency so that the correct version is available. More info here: stylelint-scss/stylelint-config-standard-scss#5 * Fixed stylelint issues in phase banner Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ivanELEC <[email protected]>
add dependency and set up stylelint config
I am using Nuxt 2 and Webpack To fix this: build: {
postcss: null
} |
Thank you so much. I take all night to resolve this problem。 thanks! QAQ |
Following this recommendation: stylelint-scss/stylelint-config-standard-scss#5 (comment)
Following this recommendation: stylelint-scss/stylelint-config-standard-scss#5 (comment)
By installing PostCSS Following this recommendation: stylelint-scss/stylelint-config-standard-scss#5 (comment)
By installing PostCSS Following this recommendation: stylelint-scss/stylelint-config-standard-scss#5 (comment)
- TypeError: Cannot read properties of undefined (reading 'stringify') - post-css 버전 의존성 이슈 (stylelint-scss/stylelint-config-standard-scss#5 (comment))
- see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5
- see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5
- see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5
- see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5
- see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5
* Add `stylelint` and scss configs - see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5 * Convert `.stylelintrc` to `.stylelintrc.js` + add scss configs - JS file helps us do things like leave meaningful comments, which JSON doesn't allow * Update ignored files - previously ignored files were added due to vscode's overeager linting - it looks like said plugin no longer does so, so we can remove non `.scss` files - port over sass-lint excludes - add missed datepicker dir - add non-src files - remove no-longer-existant chart dir * Remove sass-lint, swap over yarn shortcuts * Convert camelCase name linting * Convert indentation lint rule + fix issues caught by stylelint but not by sass-lint - unlike sass-lint, stylelint checks indentation of comments and also checks for tabs vs spaces + fix a few unnecessary `()`s, and add a disable because stylelint is confused by scss maps + remove unnecessary indentation disables * Convert single quotes lint rule + add skip for Sass scenarios where `"` has to be used for interpolation * Convert brace style lint rule - there isn't a handy `1tbs` option like eslint/sass-lint, so we need to combine a few different rules to get the effecrt we want + fix various instances where stylelint caught unnecessary double spaces before braces * Convert various value lint preferences + include some rules that stylelint is more strict about than sass-lint was * Fix pseudo-element lint rule - sass-lint was incorrectly marking pseudo *classes* as needing two `::`, whereas only pseudo *elements* need two `::`s. stylelint appears to correctly catch this OOTB @see https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements * Convert newline between rulesets/blocks lint rule * [opinionated] Add several new lint rules catching extra newlines/whitespace - prettier does the same/similar for JS/CSS-in-JS in any case * Add lint rule for 1 selector per line - already appears to be something we do or was enforced by sass-lint, but stylelint needs the explicit rule * Convert/fix rules around syntax whitespaces * [opinionated] Fix several comment rules stylelint ships with OOTB - specifically around empty comments & spacing around comments - I find them to be valid and inline with JS linting * Fix `no-duplicate-selectors` caught by stylelint (but not sass-lint) * Override default stylelint rules for backwards-compatability - without these added rules, we get stylelint errors for how we currently write our CSS - although we may want to consider removing these in the future & using more modern syntax * Fix vendor prefix linting by converting to stylelint-disable syntax * Disable various opinionated stylelist defaults - that were not previous enforced by sass-lint - we can consider turning them on at a later time if we want * Convert no `!important` rule and overrides + remove unnecessary disables * Convert nesting depth rule - default with sass-lint but not with stylelint or existing configs + remove unnecessary disables + add newly necessary disables (some it's unclear why sass-lint didn't catch, and some are due to sass syntax, which stylelint unfortunately does not care about) * Convert Sass empty ruleset lint rule - by default, stylelint considers comments to not make the block empty * Convert qualifying elements selector lint rule * Clarify function name lint rule + remove disables * Attempt to convert - this is not perfect - stylelint does not appear to have a 1:1 with sass-lint on this, but it's somewhat close and will become less of an issue as we migrate to Emotion + remove disable lines that no longer apply * Remove unnecessary sass lint disables - no-mispelled-properties is simply wrong / out of date - no-warn was already disabled in -sass-lint.yml - empty-args isn't useful in a post-sass world * 🚫 Remove mixin order rule - there's no corresponding stylelint rule, and it feels pedantic / not terribly useful * 🚫 Remove border 0 rule - there's no corresponding stylelint rule, and it feels pedantic / not useful * Remove all remaining disabled sass-lint rules - these don't appear to be enforced by stylelint, and as such nothing needs to be done * Delete all sass lint config files * Add some more stylelint docs links & notes * Remove `prettier-stylelint` - It's not clear to me why that plugin was added or what it does, and it was last updated 5 years ago and uses a super old version of stylelint (8.x), so I'm removing it * [PR feedback] Remove `number-leading-zero` rule - thanks Elizabet!
I am upgrading to stylelint v14, and moving from
stylelint-config-standard
tostylelint-config-standard-scss
. When I attempt to run stylelint I get the following error, which I can only reproduce withstylelint-config-standard-scss
:Any idea as to what might be causing this issue? Here is my config file:
The text was updated successfully, but these errors were encountered: