DEV Community

Discussion on: Switching Themes in a React App with Ant Design

Collapse
 
jjaijg profile image
Jai Ganesh J

Hey @christian , thanks for the great post.
I tired following your post, but I am facing some issue while starting the application, could you please help me with that.

./src/themes/theme.light.less (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-9-1!./node_modules/postcss-loader/src??ref--5-oneOf-9-2!./node_modules/less-loader/dist/cjs.js??ref--5-oneOf-9-3!./src/themes/theme.light.less)
TypeError: this.getOptions is not a function

Collapse
 
chrsi profile image

Hello @jjaijg ,
sorry i couldn't get to you any earlier. What version of webpack, css-loader, less-loader and postcss-loader are you using?
According to github.com/webpack-contrib/less-lo... it seems like less-loader v8 requires at least webpack v5. It was released Feb 1, which might have caused your issue. So maybe upgrading webpack oder downgrading less-loader to v7.x.x might solve the issue.