Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

TypeError while processing place-* properties #225

Closed
OpportunityLiu opened this issue Nov 19, 2021 · 5 comments
Closed

TypeError while processing place-* properties #225

OpportunityLiu opened this issue Nov 19, 2021 · 5 comments
Labels

Comments

@OpportunityLiu
Copy link

OpportunityLiu commented Nov 19, 2021

https://runkit.com/opportunity/typeerror-while-processing-place--properties

const postcss = require('postcss'); // 8.3.11
const postcssPresetEnv = require('postcss-preset-env'); //7.0.0
const autoprefixer = require('autoprefixer'); // 10.4.0

const YOUR_CSS = `
a {
  place-self: center;
}
`;

console.log(await postcss([autoprefixer({ overrideBrowserslist: 'defaults' })])
    .process(YOUR_CSS, { from: undefined }))
// this succeeded

console.log(await postcss([postcssPresetEnv({ browsers: 'defaults' })])
    .process(YOUR_CSS, { from: undefined }))
// this throws
TypeError: Cannot read properties of undefined (reading 'includes')
    at <input css A2IwH2>:3:3
    at OldValue.check (C:\U\node_modules\autoprefixer\lib\old-value.js:15:15)
    at C:\U\node_modules\autoprefixer\lib\processor.js:464:22
    at C:\U\node_modules\postcss\lib\container.js:72:18
    at C:\U\node_modules\postcss\lib\container.js:55:18
    at Rule.each (C:\U\node_modules\postcss\lib\container.js:41:16)
    at Rule.walk (C:\U\node_modules\postcss\lib\container.js:52:17)
    at C:\U\node_modules\postcss\lib\container.js:60:24
    at Root.each (C:\U\node_modules\postcss\lib\container.js:41:16)
    at Root.walk (C:\U\node_modules\postcss\lib\container.js:52:17)
    at Root.walkDecls (C:\U\node_modules\postcss\lib\container.js:70:19) {
  postcssNode: <ref *2> Declaration {
    raws: { before: '\n  ', between: ': ' },
    type: 'decl',
    source: { start: [Object], input: [Input], end: [Object] },
    prop: 'align-items',
    value: undefined,
    parent: <ref *1> Rule {
      raws: [Object],
      type: 'rule',
      nodes: [Array],
      parent: [Root],
      source: [Object],
      selector: 'a',
      lastEach: 16,
      indexes: [Object],
      proxyCache: [Circular *1],
      _autoprefixerDisabled: false,
      [Symbol(isClean)]: true,
      [Symbol(my)]: true
    },
    proxyCache: [Circular *2],
    _autoprefixerDisabled: false,
    [Symbol(isClean)]: true,
    [Symbol(my)]: true
  }
}
@Antonio-Laguna
Copy link
Member

@OpportunityLiu this should hopefully be fixed but runkit is still having the old version cached. Not sure if this is a small case from your codebase.

@OpportunityLiu
Copy link
Author

That's ok. Just use runkit to make sure this is not caused by other installed packages.

@romainmenke
Copy link
Member

Thank you @OpportunityLiu for reporting this by the way!

We found another bug while looking into this one.
Always helpful to receive feedback :)

@Antonio-Laguna
Copy link
Member

@OpportunityLiu I've tried to fix this on runkit and wasn't able. I couldn't reproduce this bug locally nor on a simple node file with the same code on the runkit. Are you experiencing this locally?

@OpportunityLiu
Copy link
Author

@Antonio-Laguna Nope, just a warning of #224

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants