Skip to content
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

在 Next.js (App Router) 中使用 NutUI Button 组件报错 Unhandled Runtime Error #2938

Open
daelan-zhou opened this issue Jan 14, 2025 · 0 comments

Comments

@daelan-zhou
Copy link

NutUI React 包名

@nutui/nutui-react

NutUI React 版本号

2.7.6

平台

h5

重现链接

https://codesandbox.io/p/devbox/5w72y5?embed=1&file=%2Fsrc%2Fapp%2Fpage.tsx&showConsole=true

重现步骤

pnpm install && pnpm dev 启动项目
/src/app/page.tsx 默认显示 Cell 组件,这个组件显示是正常的
将 Cell 组件注释掉,放开 Button 组件代码段,页面报错

期望的结果是什么?

期望 Button 组件能正常显示

实际的结果是什么?

页面报错如下:

Unhandled Runtime Error

TypeError: Cannot read properties of undefined (reading 'ReactCurrentDispatcher')

./node_modules/.pnpm/@[email protected]/node_modules/@nutui/icons-react/dist/es/icons/IconTemplate-b7c83a60.mjs
file:///project/workspace/.next/static/chunks/app/page.js (2678:1)
options.factory
file:///project/workspace/.next/static/chunks/webpack.js (712:31)
__webpack_require__
file:///project/workspace/.next/static/chunks/webpack.js (37:33)
fn
file:///project/workspace/.next/static/chunks/webpack.js (369:21)
./node_modules/.pnpm/@[email protected]/node_modules/@nutui/icons-react/dist/es/icons/AddCircle.js
file:///project/workspace/.next/static/chunks/app/page.js (39:1)
options.factory
file:///project/workspace/.next/static/chunks/webpack.js (712:31)
__webpack_require__
file:///project/workspace/.next/static/chunks/webpack.js (37:33)
fn
file:///project/workspace/.next/static/chunks/webpack.js (369:21)
./node_modules/.pnpm/@[email protected]/node_modules/@nutui/icons-react/dist/es/index.es.js
file:///project/workspace/.next/static/chunks/app/page.js (2558:1)
options.factory
file:///project/workspace/.next/static/chunks/webpack.js (712:31)
__webpack_require__
file:///project/workspace/.next/static/chunks/webpack.js (37:33)
fn
file:///project/workspace/.next/static/chunks/webpack.js (369:21)
./node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nutui/nutui-react/dist/esm/button2.js
file:///project/workspace/.next/static/chunks/app/page.js (2580:1)
options.factory
file:///project/workspace/.next/static/chunks/webpack.js (712:31)
__webpack_require__
file:///project/workspace/.next/static/chunks/webpack.js (37:33)
fn
file:///project/workspace/.next/static/chunks/webpack.js (369:21)
eval
./src/app/page.tsx
./src/app/page.tsx
file:///project/workspace/.next/static/chunks/app/page.js (2635:1)
options.factory
file:///project/workspace/.next/static/chunks/webpack.js (712:31)
__webpack_require__
file:///project/workspace/.next/static/chunks/webpack.js (37:33)
fn
file:///project/workspace/.next/static/chunks/webpack.js (369:21)

环境信息

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 AMD EPYC
    Memory: 1.41 GB / 4.01 GB
    Container: Yes
    Shell: Unknown
  Binaries:
    Node: 20.12.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    @nutui/nutui-react: ^2.7.6 => 2.7.6

其他补充信息

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant