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

(4.x): Cannot access '_raf' before initialization #15981

Closed
b1ngx opened this issue Jun 24, 2024 · 4 comments
Closed

(4.x): Cannot access '_raf' before initialization #15981

b1ngx opened this issue Jun 24, 2024 · 4 comments

Comments

@b1ngx
Copy link
Contributor

b1ngx commented Jun 24, 2024

相关平台

微信小程序

小程序基础库: 2.33
使用框架: React

复现步骤

compiler: {
  type: 'webpack5',
  prebundle: {
    enable: false,
  },
}

npm run build

image

期望结果

不报错

实际结果

正确运行

环境信息

👽 Taro v4.0.0-alpha.26


  Taro CLI 4.0.0-alpha.26 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
      npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/components: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/helper: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/plugin-framework-react: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/plugin-platform-weapp: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/react: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/runtime: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/shared: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/taro: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/taro-loader: 4.0.0-alpha.26 => 4.0.0-alpha.26
      @tarojs/webpack5-runner: 4.0.0-alpha.26 => 4.0.0-alpha.26
      babel-preset-taro: 4.0.0-alpha.26 => 4.0.0-alpha.26
      react: ^18.3.1 => 18.3.1
@koppthe
Copy link
Contributor

koppthe commented Jun 24, 2024

启用「将 JS 编译成 ES5」
image

@koppthe koppthe closed this as completed Jun 24, 2024
@b1ngx
Copy link
Contributor Author

b1ngx commented Jun 26, 2024

image

文档需要设置关闭 ES6 转 ES5 功能,开启可能报错

This was referenced Jun 29, 2024
@b1ngx
Copy link
Contributor Author

b1ngx commented Jul 15, 2024

Solved in f719166

@deng565430
Copy link

4.03版本还是如此。
复现:
compiler: { type: "webpack5", prebundle: { enable: false, }, },
报错:
image

根据issues提示:
1、启用「将 JS 编译成 ES5」
报错:
image

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

3 participants