ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
235 stars 57 forks source link

extractStyle(cache)返回是的content是"",cache打印有内容 #153

Open zzkaqq opened 8 months ago

zzkaqq commented 8 months ago

根据官方示例: image

控制台打印: image

实际渲染结果: image

框架:nextjs@14.0.0 模式:APP Router antd:5.10.2

Stuart88 commented 7 months ago

我也遇到这个问题

nguyenlephong commented 5 months ago

I am also dealing with this issue; it has disrupted my work for over three days.

    Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.17.0
      npm: 9.6.7
      Yarn: 3.2.4
      pnpm: 8.6.10
    Relevant packages:
      next: 13.1.6
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      "antd": "5.9.4"
9vfQbg7z4ajrGQxR commented 5 months ago

had this too with nextjs and app router, that cause styles blinking on Antd components, for solve this problem you can extractStyle() inside a ".css" file and import the css file

fabricioloupias commented 3 months ago

had this too with nextjs and app router, that cause styles blinking on Antd components, for solve this problem you can extractStyle() inside a ".css" file and import the css file

can you please show an example of this?

lululuting commented 2 months ago

这个问题没有解决方法吗?

Dmi3Iva commented 2 months ago

had this too with nextjs and app router, that cause styles blinking on Antd components, for solve this problem you can extractStyle() inside a ".css" file and import the css file

can you please show an example of this?

You can find example here. If styles will be empty pay attention to versions of packages. https://ant.design/docs/react/server-side-rendering#whole-export

Issue related to package version. There is the version number without bug with empty styles. https://github.com/ant-design/static-style-extract/issues/3