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

ConfigProvider中的useConfig报错'style' of undefined #2513

Closed
chioio opened this issue Aug 2, 2024 · 1 comment
Closed

ConfigProvider中的useConfig报错'style' of undefined #2513

chioio opened this issue Aug 2, 2024 · 1 comment
Labels
to be closed 未提供最小化可复现 demo 且长期无进展的 issue

Comments

@chioio
Copy link

chioio commented Aug 2, 2024

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

2.6.14

平台

weapp

重现链接

https://github.com/chioio/nutui-taro-configprovider-error

重现步骤

  1. 初始化Taro NutUI App
  2. 修改babel import配置
  3. 使用ConfigProvider
  4. 使用useConfig
  5. 报错
[email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:98 TypeError: Cannot read property 'style' of undefined
    at ConfigProvider (._node_modules_.pnpm_@[email protected][email protected][email protected][email protected]_node_modules_@nutui_nutui-react-taro_dist_esm_configprovider.taro-DA4GDDFu.js:179)
    at Demo (index.jsx?f47a:29)
    at Ke ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:78)
    at Sh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:196)
    at Rh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:186)
    at Qh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:186)
    at Gh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:186)
    at Lh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:177)
    at Eh ([email protected][email protected]_node_modules_react-reconciler_cjs_react-reconciler.production.min.js:175)
    at workLoop ([email protected]_node_modules_scheduler_cjs_scheduler.development.js:266)(env: macOS,mp,1.06.2405020; lib: 3.5.3)

Tip: NutUI React 正常

期望的结果是什么?

调用 useConfig 正常

实际的结果是什么?

报错 style of undefined

环境信息

Taro CLI 3.6.34 environment info:
System:
OS: macOS 13.6.7
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.12.0 - ~/Library/Caches/fnm_multishells/25267_1653168489651/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 8.19.2 - ~/Library/Caches/fnm_multishells/25267_1653168489651/bin/npm
npmPackages:
@tarojs/cli: 3.6.34 => 3.6.34
@tarojs/components: 3.6.34 => 3.6.34
@tarojs/helper: 3.6.34 => 3.6.34
@tarojs/plugin-framework-react: 3.6.34 => 3.6.34
@tarojs/plugin-html: 3.6.34 => 3.6.34
@tarojs/plugin-platform-alipay: 3.6.34 => 3.6.34
@tarojs/plugin-platform-h5: 3.6.34 => 3.6.34
@tarojs/plugin-platform-jd: 3.6.34 => 3.6.34
@tarojs/plugin-platform-qq: 3.6.34 => 3.6.34
@tarojs/plugin-platform-swan: 3.6.34 => 3.6.34
@tarojs/plugin-platform-tt: 3.6.34 => 3.6.34
@tarojs/plugin-platform-weapp: 3.6.34 => 3.6.34
@tarojs/react: 3.6.34 => 3.6.34
@tarojs/runtime: 3.6.34 => 3.6.34
@tarojs/shared: 3.6.34 => 3.6.34
@tarojs/taro: 3.6.34 => 3.6.34
@tarojs/taro-loader: 3.6.34 => 3.6.34
@tarojs/webpack5-runner: 3.6.34 => 3.6.34
babel-preset-taro: 3.6.34 => 3.6.34
eslint-config-taro: 3.6.34 => 3.6.34
react: ^18.0.0 => 18.3.1

其他补充信息

No response

@xiaoyatong
Copy link
Collaborator

试着改下配置。

@Alex-huxiyang Alex-huxiyang added the to be closed 未提供最小化可复现 demo 且长期无进展的 issue label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be closed 未提供最小化可复现 demo 且长期无进展的 issue
Projects
None yet
Development

No branches or pull requests

3 participants