-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Styles loaded after initial render in production mode using ant design with less #8826
Comments
Overriding _app.js is a way to fix it ! |
Not sure this would help, but I import Antd in the following way, without messing up with the webpack config:
const withPlugins = require("next-compose-plugins");
const less = require("@zeit/next-less");
module.exports = withPlugins([
[less, { lessLoaderOptions: { javascriptEnabled: true } }]
]);
import "../styles/antd/antd.less";
... This seems to work just fine. |
No really working... For exemple, when i'm using Drawer from ant design, transition isn't working. |
I am experiencing the same problem. Request a solution. help me |
My latest experiment, doesn't work |
Has your problem been solved? |
I manage to find a temporary solution by not putting style element in Next.Js Head. I don't know why, but when putting style element in Head, it is working at initial render but when navigation between page using Link (from next/link), style element is happened again in the tree.
And before exporting my class
|
@cfaure004 is the solution still working for you? I tried but, the Antd still loads with a flash.... |
Yes it's working well using my previous comment ! |
Duplicate of #9830 |
This comment has been minimized.
This comment has been minimized.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Examples bug report
Describe the bug
When using a complete copy of with-ant-design-less sample, styles are loaded after an initial page render when nextjs is built to production
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
Styles should be loaded before initial render
Screenshots
System information
Additional context
I tried to deploy using my nextjs app using now and same issue is happening.
The text was updated successfully, but these errors were encountered: