Skip to content
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

webpack complains about "start" value when we should be using "flex-start" (probably) #23595

Closed
turt2live opened this issue Oct 25, 2022 · 6 comments · Fixed by matrix-org/matrix-react-sdk#9500 or #27568
Assignees
Labels
A-Developer-Experience O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Tolerable Low/no impact on users T-Defect

Comments

@turt2live
Copy link
Member

see #22823

@luixxiul
Copy link

Happening again. The PR to address it: matrix-org/matrix-react-sdk#10163

@richvdh
Copy link
Member

richvdh commented Jan 4, 2024

Irrespective of whether the warnings are valid, they are hella annoying, so I'm reopening this issue.

I don't know if the correct fix is to fix webpack or fix our css.

@richvdh richvdh reopened this Jan 4, 2024
@richvdh
Copy link
Member

richvdh commented Jan 4, 2024

This warning is coming from autoprefixer, of which we are using a rather old version (9.8.8, released Oct 4, 2021). I suspect this is because we are using an even older postcss-preset-env version (6.7.0, released 9 July 2019. 6.7.2 was released a couple of months ago, but I suspect it was a minor update. I can't find a changelog that explains the difference.)

@richvdh
Copy link
Member

richvdh commented Jan 4, 2024

I spent a bit of time looking into whether this was an easy fix, but I'm going to have to give up.

I heavily suspect this is a side-effect of us using ancient postcss (despite the dependency on "postcss": "^8.4.31" in package.json, we're actually using postcss 7 because we're on a very old version of postcss-loader). I tried upgrading postcss-loader, but now I get errors like:

ERROR in ../matrix-react-sdk/res/css/_common.pcss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/css/_common.pcss)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Package path ./dist/style.css is not exported from package /home/rav/work/matrix-react-sdk/node_modules/@vector-im/compound-web (see exports field in /home/rav/work/matrix-react-sdk/node_modules/@vector-im/compound-web/package.json)
 @ ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/css/_components.pcss 5:0-220 399:26-59
 @ ../matrix-react-sdk/res/themes/dark-custom/css/dark-custom.pcss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/themes/dark-custom/css/dark-custom.pcss 10:0-247 18:26-59
 @ ../matrix-react-sdk/res/themes/dark-custom/css/dark-custom.pcss

and

ERROR in ../matrix-react-sdk/res/css/components/views/polls/_PollOption.pcss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/css/components/views/polls/_PollOption.pcss)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Can't resolve '$(res)/img/element-icons/check-white.svg' in '/home/rav/work/matrix-react-sdk/res/css/components/views/polls'
 @ ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/css/_components.pcss 41:0-248 435:26-60
 @ ../matrix-react-sdk/res/themes/dark-custom/css/dark-custom.pcss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/themes/dark-custom/css/dark-custom.pcss 10:0-247 18:26-59
 @ ../matrix-react-sdk/res/themes/dark-custom/css/dark-custom.pcss

... and I don't know how to fix them.

richvdh added a commit to element-hq/compound-web that referenced this issue Jan 4, 2024
For some reason that I don't entirely understand, the conditional export here seems to upset postcss-loader (element-hq/element-web#23595 (comment)) -- possibly because this is neither a cjs nor an es6 import. Since both `require` and `import` point to the same file, we might as well make it unconditional.
@richvdh
Copy link
Member

richvdh commented Jan 4, 2024

Error: Package path ./dist/style.css is not exported from package /home/rav/work/matrix-react-sdk/node_modules/@vector-im/compound-web (see exports field in /home/rav/work/matrix-react-sdk/node_modules/@vector-im/compound-web/package.json)

This actually seems to be unhappy about the conditional export in https://github.com/element-hq/compound-web/blob/main/package.json#L15-L18; since both exports are the same the easiest fix may just be to turn it into an unconditional export (element-hq/compound-web#136).

That doesn't help with the $(res) error though. I don't know where $(res) is supposed to be defined.

richvdh added a commit to element-hq/compound-web that referenced this issue Jan 7, 2024
For some reason that I don't entirely understand, the conditional export here seems to upset postcss-loader (element-hq/element-web#23595 (comment)) -- possibly because this is neither a cjs nor an es6 import. Since both `require` and `import` point to the same file, we might as well make it unconditional.
@richvdh
Copy link
Member

richvdh commented Feb 20, 2024

I was hoping this might have been fixed by #26993 which updated postcss and autoprefix, but it seems not:

2024-02-20 10:10:31.610 [element-js] WARNING in ../matrix-react-sdk/res/themes/dark/css/dark.pcss (../matrix-react-sdk/res/themes/dark/css/dark.pcss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/themes/dark/css/dark.pcss)
2024-02-20 10:10:31.610 [element-js] Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
2024-02-20 10:10:31.610 [element-js] (23:3) from "autoprefixer" plugin: start value has mixed support, consider using flex-start instead
2024-02-20 10:10:31.610 [element-js] 
2024-02-20 10:10:31.610 [element-js] Code:
2024-02-20 10:10:31.610 [element-js]   align-items: start
2024-02-20 10:10:31.610 [element-js] 
2024-02-20 10:10:31.610 [element-js] 
2024-02-20 10:10:31.610 [element-js] WARNING in ../matrix-react-sdk/res/themes/dark/css/dark.pcss (../matrix-react-sdk/res/themes/dark/css/dark.pcss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??postcss!../matrix-react-sdk/res/themes/dark/css/dark.pcss)
2024-02-20 10:10:31.610 [element-js] Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
2024-02-20 10:10:31.610 [element-js] (24:3) from "autoprefixer" plugin: start value has mixed support, consider using flex-start instead
2024-02-20 10:10:31.610 [element-js] 
2024-02-20 10:10:31.610 [element-js] Code:
2024-02-20 10:10:31.610 [element-js]   justify-content: start
2024-02-20 10:10:31.610 [element-js] 
2024-02-20 10:10:31.610 [element-js] 

(etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Tolerable Low/no impact on users T-Defect
Projects
None yet
4 participants