-
Notifications
You must be signed in to change notification settings - Fork 268
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
addLessLoader issue when using less-loader #241
Comments
Experiencing this too |
Seem like issue come from here: customize-cra/src/customizers/webpack.js Lines 167 to 169 in 404854b
|
any update ? |
No lib fixes yet |
I am also facing this issue, I can recommend trying out patch-package so that it won't block you. Subscribe to this issue to know when it closes and is fixed, then simply delete the patch and clean up as necessary |
same problem !!! |
same problem |
same problem |
need use customize-cra@next and lessOption |
I can also confirm Wulawa's answer, just install I'm not very confident on the author fixing this issue with the various PR's that have been created for him and the build up of comments on these issues, and the next branch has not been committed to since November. Try installing next version |
This is a workaround. It works fine with customize-cra v1.0.0-alpha.0 |
Still does not work for me. I'm using this in combination with Ant Design, to customize the less library. "less-loader": "^6.1.0",
"customize-cra": "^1.0.0-alpha.0", |
I wasn't able to get the alpha version to work with antd. A few issue tickets were made and antd now recommends craco . I switched and haven't had a problem with it. |
I did the same. Can confirm that it's working flawlessly for me |
Hey folks, The changes in the Hopefully this resolves a majority of the issues in the thread. Please do let me know if you still run into issues; I'll keep this issue thread open for a few days. |
I also have the same problem. The following is my config file :
|
Hi @ZeroTo0ne, Can you try the following:
We've pushed out a change in the latest |
Hi @Anish-Agnihotri , Thanks for your advice.
The
Then it works well. |
I'm getting the following error:
My config: const { override, fixBabelImports, addLessLoader } = require('customize-cra');
const path = require('path');
const fs = require('fs');
const lessToJs = require('less-vars-to-js');
const customTheme = lessToJs(
fs.readFileSync(path.join(__dirname, './src/style/myAntdTheme.less'), 'utf8'),
);
const myColors = lessToJs(
fs.readFileSync(path.join(__dirname, './src/style/colors.less'), 'utf8'),
);
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
addLessLoader({
lessOptions: {
modifyVars: { ...customTheme, ...myColors },
javascriptEnabled: true,
}
}),
); Versions: "customize-cra": "^1.0.0",
"less": "^3.11.1",
"less-vars-to-js": "^1.3.0",
"babel-plugin-import": "^1.13.0",
"less-loader": "^6.1.0",
"antd": "^4.2.5",
"react-app-rewired": "^2.1.5", EDIT: Switched to |
Same issiue here with Antd design.
Failed to compile. |
important : change |
I solved fix by installing customize-cra-less-loader package.json:
config-override.js:
|
It works for me! |
I'm using react-app-rewired and I've recently updated less-loader to the new version (6.0.0). My customize-cra version is 0.9.1.
I'm getting the following error when I run react-app-rewired build:
ValidationError: Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.
options has an unknown property 'source'. These properties are valid:
object { lessOptions?, prependData?, appendData?, sourceMap? }
I've the config-overrides.js file like this:
I added the lessOptions object but it didn't solve the problem.
Could you tell me which is the proper way to set addLessLoader options?
Thanks in advance,
The text was updated successfully, but these errors were encountered: