-
Notifications
You must be signed in to change notification settings - Fork 4.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
pxtransform 拿不到 config中的值 #17156
Comments
看了下代码是在调用pxTransform,还没有init完。 |
This was referenced Jan 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
H5
浏览器版本: Chrome/131.0.0.0
使用框架: React
复现步骤
我现在在将1.3.9升级到4.0.8,升级过程中报错 ”vendors-node_modules_taro_h5_prebundle_chunk-DZCD4O6R_js.js:18426 Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'undefined' in undefined
at pxTransform (vendors-node_modules_taro_h5_prebundle_chunk-DZCD4O6R_js.js:18426:23)
at eval (webpack-internal:///./src/components/tempItem/index.js:268:70)
at ./src/components/tempItem/index.js (src_app_boot_js.js:2097:1)
at options.factory (runtime.js:966:31)
at webpack_require (runtime.js:34:32)
at fn (runtime.js:624:21)
at eval (webpack-internal:///./src/pages/home/index.js:38:85)
at ./src/pages/home/index.js (src_app_boot_js.js:2174:1)
at options.factory (runtime.js:966:31)
at webpack_require (runtime.js:34:32)“,查看代码发现没有读到config中的值。
然后我新建一个项目,在useLaunch中使用Taro.pxTransform(10)同样报错,报错信息如下
”Uncaught TypeError: Cannot read properties of undefined (reading 'pxTransform')
at eval (app.js:10:1)
eval @ app.js:10
setTimeout
eval @ app.js:9
callback @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:90
(匿名) @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:480
triggerAppHook @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:480
onLaunch @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:409
(匿名) @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:292
Promise.then
waitAppWrapper @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:292
value @ vendors-node_modules_taro_h5_prebundle_chunk-YE3WZ4YS_js.chunkhash.js:411
createRouter @ vendors-node_modules_taro_h5_prebundle_chunk-YZEYTA5X_js.chunkhash.js:41276
eval @ app.boot.js:47
./src/app.boot.js @ src_app_boot_js.chunkhash.js:84
options.factory @ runtime.c77173c8.js:798
webpack_require @ runtime.c77173c8.js:34
fn @ runtime.c77173c8.js:456
Promise.then
eval @ app.config.js:1
./src/app.config.js @ app.c77173c8.js:49
options.factory @ runtime.c77173c8.js:798
webpack_require @ runtime.c77173c8.js:34
webpack_exec @ app.c77173c8.js:2004
(匿名) @ app.c77173c8.js:2005
webpackJsonpCallback @ runtime.c77173c8.js:1415
(匿名) @ app.c77173c8.js:9“
期望结果
期望可以正常使用
实际结果
报错
环境信息
The text was updated successfully, but these errors were encountered: