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

v3.6.34升级到v4.0.7版本后使用vite构建打包,@redux/toolkit的createSlice is not a function #16859

Open
HongxuanG opened this issue Nov 13, 2024 · 6 comments

Comments

@HongxuanG
Copy link

相关平台

微信小程序

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

复现步骤

打包@redux/toolkit后微信开发工具出现 vendors.createSlice is not a function 错误,打开common.js和vendor.js存在循环引用
image
image
image
image

期望结果

正常运行

实际结果

报错
image
image
image
image

环境信息

👽 Taro v4.0.7


  Taro CLI 4.0.7 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
      npm: 10.8.0 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.7 => 4.0.7
      @tarojs/components: 4.0.7 => 4.0.7
      @tarojs/helper: 4.0.7 => 4.0.7
      @tarojs/plugin-framework-react: 4.0.7 => 4.0.7
      @tarojs/plugin-mini-ci: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-alipay: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-h5: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-jd: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-qq: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-swan: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-tt: 4.0.7 => 4.0.7
      @tarojs/plugin-platform-weapp: 4.0.7 => 4.0.7
      @tarojs/react: 4.0.7 => 4.0.7
      @tarojs/runtime: 4.0.7 => 4.0.7
      @tarojs/shared: 4.0.7 => 4.0.7
      @tarojs/taro: 4.0.7 => 4.0.7
      @tarojs/taro-loader: 4.0.7 => 4.0.7
      @tarojs/vite-runner: ^4.0.7 => 4.0.7
      @tarojs/webpack5-runner: 4.0.7 => 4.0.7
      babel-preset-taro: 4.0.7 => 4.0.7
      eslint-config-taro: 4.0.7 => 4.0.7
      react: ^18.0.0 => 18.3.1

This was referenced Nov 16, 2024
@xixihhhh
Copy link

我也遇到这个问题,切换成webpack5编译试试呢

@HongxuanG
Copy link
Author

我也遇到这个问题,切换成webpack5编译试试呢

我就是不想用webpack5,跟vite比起来觉得太慢了

@shiyl962
Copy link

我也遇到这个问题,切换成webpack5编译试试呢

我就是不想用webpack5,跟vite比起来觉得太慢了

这篇文章中说,用vite打包微信小程序,没有带来性能提升,是否准确呢
Taro4.0支持使用Vite构建

@HongxuanG
Copy link
Author

我也遇到这个问题,切换成webpack5编译试试呢

我就是不想用webpack5,跟vite比起来觉得太慢了

这篇文章中说,用vite打包微信小程序,没有带来性能提升,是否准确呢 Taro4.0支持使用Vite构建

自我感觉来说。使用vite打包我现在的项目来说比用webpack5打包要快

@shiyl962
Copy link

我也遇到这个问题,切换成webpack5编译试试呢

我就是不想用webpack5,跟vite比起来觉得太慢了

这篇文章中说,用vite打包微信小程序,没有带来性能提升,是否准确呢 Taro4.0支持使用Vite构建

自我感觉来说。使用vite打包我现在的项目来说比用webpack5打包要快

除了打包快,包大小、运行性能如何啊?
另外,看了你的跟踪分析,是个高手啊!!!

@HongxuanG
Copy link
Author

我也遇到这个问题,切换成webpack5编译试试呢

我就是不想用webpack5,跟vite比起来觉得太慢了

这篇文章中说,用vite打包微信小程序,没有带来性能提升,是否准确呢 Taro4.0支持使用Vite构建

自我感觉来说。使用vite打包我现在的项目来说比用webpack5打包要快

除了打包快,包大小、运行性能如何啊? 另外,看了你的跟踪分析,是个高手啊!!!

运行性能的话我还不知道。。。因为vite打包之后就遇到这个问题了,我现在也还是用回webpack5,v3.6.34版本,这个问题的话得抽个时间写个demo复现一下才行不然没人改

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