Open Benjaminbai opened 3 years ago
use the create-react-app
create project.
edit config/webpack.config.js
as follows :
// .......
const AntDesignThemePlugin = require("antd-theme-webpack-plugin");
const options = {
antDir: path.join(paths.appPath, "./node_modules/antd"),
stylesDir: path.join(paths.appPath, "./src"),
varFile: path.join(paths.appPath, "./src/assets/theme/var.less"), // default path is Ant Design default.less file
themeVariables: [
"@primary-color",
"@link-color",
"@success-color",
"@warning-color",
"@error-color",
"@layout-text",
"@layout-background",
"@heading-color",
"@text-color",
"@text-color-secondary",
"@disabled-color",
"@border-color-base",
],
indexFileName: "index.html",
generateOnce: false,
};
const themePlugin = new AntDesignThemePlugin(options);
// ..................
module.exports = function (webpackEnv) {
// .............................
return {
mode: isEnvProduction ? "production" : isEnvDevelopment && "development",
//.................
plugins:[
themePlugin,
new HtmlWebpackPlugin(....),
// ...........
]
}
}
then,use the command node script/start
run the project.Find everything in normal operation
but,when I edit src/....less
,This will happen
I had the same issue.
+1
same issue here
+1
+1
+1
+1
+1!
+1
@Benjaminbai @kongyijilafumi @Nice-yang @tsiotska @ekiliqua @Ginxo @PingZai-Tse @TomasTarasovic Can any one of you setup a public repository and reproduce this bug. I'll fix that. Currently, above mentioned information is not enough. This issue contains no information about CRA version, ANTD version, nothing.
@Benjaminbai @kongyijilafumi @Nice-yang @tsiotska @ekiliqua @Ginxo @PingZai-Tse @TomasTarasovic Can any one of you setup a public repository and reproduce this bug. I'll fix that. Currently, above mentioned information is not enough. This issue contains no information about CRA version, ANTD version, nothing.
I can say that i used Vue 3, Antdv2.x (2.2.2) and this issue is caused by hot-reload (dead on when editing theme variables)
@Benjaminbai @kongyijilafumi @Nice-yang @tsiotska @ekiliqua @Ginxo @PingZai-Tse @TomasTarasovic Can any one of you setup a public repository and reproduce this bug. I'll fix that. Currently, above mentioned information is not enough. This issue contains no information about CRA version, ANTD version, nothing.
I create the demo,link
@mzohaibqc I have the same issue here. There is a function named combineLess in antd-theme-generator that gets filePath as an argument. I figured out that each line in recursive map is falling in an infinite loop and It causes Maximum call stack size exceeded.
@kongyijilafumi I cloned and run your project. it worked well, no such memory issue found.
@amirrstm Can you reproduce this and share?
I also have this exact same issue using antd 4.2, and CRA5/webpack5, with craco.
Did anyone find a solution to this? I am facing the same issue. I won't be able to provide a replicable scenario, but I will try my best to explain my scenario and the things I debugged. Initially, my project started with the node version of v8.5.0. At that time, the version of 'antd-theme-webpack-plugin' was v1.1.8. We recently had to upgrade the node version to v14.16.1. When we did this, a lot of CSS changes got distorted. For example, CSS variables color import did not function properly. Then I updated, 'antd-theme-webpack-plugin' to the most compatible version v1.3.9. Whenever I make changes in less file, I get the above stack trace issue. antd-version: 3.x
Describe the bug Describe your bug in English language
Show your code Show your
config-overrides.js
file and styles folder structureScreenshots If applicable, add screenshots to help explain your problem.
Version Which version is installed in your application? Try using the latest version, that may help