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

运行H5报错: _chunk_54FAVIWE_js__WEBPACK_IMPORTED_MODULE_3__.taro.createSelectorQuery is not a function #16886

Open
Fiestar opened this issue Nov 18, 2024 · 1 comment

Comments

@Fiestar
Copy link

Fiestar commented Nov 18, 2024

相关平台

H5

浏览器版本: Edge 131
使用框架: React

复现步骤

npm run dev:h5

期望结果

正常打开页面,没有报错信息

实际结果

报错

环境信息


  Taro CLI 3.6.11 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD
      npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.11 => 3.6.11
      @tarojs/components: 3.6.11 => 3.6.11
      @tarojs/helper: 3.6.11 => 3.6.11
      @tarojs/plugin-framework-react: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-alipay: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-h5: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-jd: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-qq: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-swan: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-tt: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-weapp: 3.6.11 => 3.6.11
      @tarojs/react: 3.6.11 => 3.6.11
      @tarojs/runtime: 3.6.11 => 3.6.11
      @tarojs/shared: 3.6.11 => 3.6.11
      @tarojs/taro: 3.6.11 => 3.6.11
      @tarojs/taro-loader: 3.6.11 => 3.6.11
      @tarojs/webpack5-runner: 3.6.11 => 3.6.11
      babel-preset-taro: 3.6.11 => 3.6.11
      eslint-config-taro: 3.6.11 => 3.6.11
      react: ^18.0.0 => 18.3.1
      taro-ui: 3.3.0 => 3.3.0

补充信息

运行微信小程序没有问题, 编译H5也成功,但是实际页面上报错;
Snipaste_2024-11-18_18-23-51

@TheKonka
Copy link
Member

import { createSelectorQuery } from '@tarojs/taro'
先这样写看看

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

2 participants