Can't get server side rendering to work with Ant design using less #14151
Unanswered
jujhaar2409
asked this question in
Help
Replies: 1 comment
-
I have the same question. 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 'javascriptEnabled'. These properties are valid:
object { lessOptions?, prependData?, appendData?, sourceMap?, implementation? } I changed the next.config.js. module.exports = withLess({
lessLoaderOptions: {
lessOptions:{ // add the obj and it's worked for me
javascriptEnabled: true,
}
}
}) You can try it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I used the ant-design-less example which is on the next.js repo as a starting point for my project. I was not able to get server side rendering of the ant design component styles working in development and even after build.
To Reproduce
npm run dev
ORnpm run build && npm start
Expected behavior
The ant design components should appear with complete styles directly from the server(check in network tab in chrome dev tools)
Current Behaviour
The components can be seen with default HTML styles for a moment before looking how they are supposed to(server side rendering not working). I can confirm this by looking at the network tab and looking for the file received from the server. It contains the elements with default HTML styles.
My code
next.config.js
.babelrc
System information
Beta Was this translation helpful? Give feedback.
All reactions