Less compilation error
See original GitHub issueERROR in ./~/css-loader?{"sourceMap":true,"importLoaders":2}!./~/postcss-loader/lib?{"sourceMap":true}!./~/less-loader/dist?{"sourceMap":true,"strictMath":true}!./~/preact-material-components/Button/style.css
Module build failed:
.mdc-button.mdc-button--primary::before {
background-color: color(var(--mdc-theme-primary, #3f51b5) a(12%)); } }
^
Error evaluating function `color`: keyword.toLowerCase is not a function
in /home/usulix/Development/accountsgui/node_modules/preact-material-components/Button/style.css (line 426, column 28)
@ ./~/preact-material-components/Button/style.css 4:14-160 18:2-22:4 19:20-166
@ ./src/lib/FormComponents/LoginButton.js
@ ./src/components/login/index.js
@ ./src/components/app.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js
Points me to trying to find the correct css processing configuration for webpack Currently I have
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: { sourceMap: CSS_MAPS, importLoaders: 2 }
},
{
loader: `postcss-loader`,
options: {
sourceMap: CSS_MAPS,
plugins: () => {
autoprefixer({ browsers: [ 'last 2 versions' ] });
}
}
},
{
loader: 'less-loader',
options: { sourceMap: CSS_MAPS, strictMath: true }
}
]
})
and the strictMath: true appears to be required to get through a different portion of the css
ERROR in ./~/css-loader?{"sourceMap":true,"importLoaders":2}!./~/postcss-loader/lib?{"sourceMap":true}!./~/less-loader/dist?{"sourceMap":true}!./~/preact-material-components/LayoutGrid/style.css
Module build failed:
padding: 8px;
padding: calc(var(--mdc-layout-grid-margin, 16px) - var(--mdc-layout-grid-gutter, 16px) / 2); }
^
Operation on an invalid type
in /home/usulix/Development/accountsgui/node_modules/preact-material-components/LayoutGrid/style.css (line 21, column 2)
@ ./~/preact-material-components/LayoutGrid/style.css 4:14-160 18:2-22:4 19:20-166
@ ./src/components/login/index.js
@ ./src/components/app.js
I was moving along well… until this keyword.toLowerCase error popped up.
and it seems to be the inability of the webpack config I have to get a value from
var(--mdc-theme-primary, #3f51b5) a(12%)
what are you doing to support var() in your css processing, please.
Thanks and best regards
Greg
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
LESS compile error - css - Stack Overflow
I am using Incident57's CodeKit pre-processor to compile a series of less files that are being imported and minified into a single CSS...
Read more >Incorrect errors from less compilation · Issue #1170 - GitHub
We have a common less file that gets imported to many different less files, and we get strange errors when building. Such as:...
Read more >Magento 2 less compilation error while setup:static-content ...
0 I am facing issue in compiling less and css files. The files styles-l.css and styles-m.css are missing - not generated. During static...
Read more >Command Line Usage - Less CSS
Less extends CSS with dynamic behavior such as variables, mixins, operations and functions. ... Set the method of error reporting when compilation fails....
Read more >Theme Compilation Issue Due to missing '{' or '}' in Input Less ...
When attempting to compile a theme, an error message similar to the following occurs: Making a change to a single less file in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have solved it. After searching a lot got this issue from less repo.
You have to enable strictMath: true in your webpack less loader option.
By default less was not supporting math function in css like calc, scale …etc
Thanks so much @john1jan u rock 👍 . @usulix lemme know if this still persist for you.