ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.54k stars 2.38k forks source link

support next14 and update doc #6499

Open zhiyongsun opened 7 months ago

zhiyongsun commented 7 months ago

Version of antd-mobile

^5.33.2

Operating system and its version

Others

Browser and its version

chrome

Sandbox to reproduce

No response

What happened?

when i added "antd-mobile": "^5.33.2" to "next": "^14.0.3", then i imported button component, got error _ahooks.createUpdateEffect

⨯ node_modules/antd-mobile/cjs/utils/use-isomorphic-update-layout-effect.js (8:72) @ _ahooks ⨯ TypeError: (0 , _ahooks.createUpdateEffect) is not a function

Relevant log output

No response

day-xue commented 7 months ago

"use client" ?

zhiyongsun commented 7 months ago

"use client" ?

yes~

zb201307 commented 7 months ago

解决了吗

day-xue commented 7 months ago

"use client" ?

yes~

我这边是没问题的

callmevari commented 6 months ago

Same happen to me. Are you using the Pages router @zhiyongsun? Cause in the new App router it works fine, but I turned my code to the Pages router (due to an opened issue) and I found this antd-mobile error. Same as you, importing only the Button component.

zhiyongsun commented 6 months ago

Same happen to me. Are you using the Pages router @zhiyongsun? Cause in the new App router it works fine, but I turned my code to the Pages router (due to an opened issue) and I found this antd-mobile error. Same as you, importing only the Button component.

yes, Pages router. app router it works

massqeen commented 6 months ago

Same here, using pages router in Next 14.0.4, got an error just importing Image component

hugejile commented 6 months ago

Page route in Next 14.1.0, antd-mobile 5.34.0, just import Button, has same error.

conversun commented 4 months ago

NextJS 14.1.3, 问题仍然存在 Collecting page data ..TypeError: (0 , n.createUpdateEffect) is not a function

hugejile commented 4 months ago

To manually install ahooks version 3.7.2 and configure the transpilePackages option to include 'antd-mobile'

jianqiao0313 commented 3 months ago

+1

ikangjie commented 2 months ago

我也有同样的问题