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

The 'compilation' argument must be an instance of Compilation 打包错误 #9465

Closed
lzt9977 opened this issue Jun 5, 2021 · 4 comments
Closed
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x

Comments

@lzt9977
Copy link

lzt9977 commented Jun 5, 2021

相关平台

微信小程序

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

复现步骤

项目打包的时候 报错 The 'compilation' argument must be an instance of Compilation 便会停滞不动

image

期望结果

打包成功

实际结果

停滞不动

环境信息

Taro v2.2.13


  Taro CLI 2.2.13 environment info:
    System:
      OS: macOS 11.2.1
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.19.1 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.13.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 2.2.13 => 2.2.13
      @tarojs/components-qa: 2.2.13 => 2.2.13
      @tarojs/mini-runner: 2.2.13 => 2.2.13
      @tarojs/plugin-less: 2.2.13 => 2.2.13
      @tarojs/plugin-sass: ^2.2.10 => 2.2.10
      @tarojs/plugin-terser: 2.2.13 => 2.2.13
      @tarojs/redux: 2.2.13 => 2.2.13
      @tarojs/redux-h5: 2.2.13 => 2.2.13
      @tarojs/router: 2.2.13 => 2.2.13
      @tarojs/taro: 2.2.13 => 2.2.13
      @tarojs/taro-alipay: 2.2.13 => 2.2.13
      @tarojs/taro-h5: 2.2.13 => 2.2.13
      @tarojs/taro-qq: 2.2.13 => 2.2.13
      @tarojs/taro-quickapp: 2.2.13 => 2.2.13
      @tarojs/taro-rn: 2.2.13 => 2.2.13
      @tarojs/taro-swan: 2.2.13 => 2.2.13
      @tarojs/taro-tt: 2.2.13 => 2.2.13
      @tarojs/taro-weapp: 2.2.13 => 2.2.13
      @tarojs/webpack-runner: 2.2.13 => 2.2.13
      eslint-config-taro: 2.2.13 => 2.2.13
      eslint-plugin-taro: 2.2.13 => 2.2.13
      nerv-devtools: ^1.5.5 => 1.5.7
      nervjs: ^1.5.5 => 1.5.7
      stylelint-config-taro-rn: 2.2.13 => 2.2.13
      stylelint-taro-rn: 2.2.13 => 2.2.13
      taro-ui: ^2.3.4 => 2.3.4

补充信息

经过查询说是可能是webpack的版本问题,这是一个老项目了 很久没动过 现在只改了一点代码 希望在不大动干戈的情况下 打包成功

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x labels Jun 5, 2021
@luckyadam
Copy link
Member

luckyadam commented Jun 8, 2021

重新装一下依赖吧,报错显示安装了 webpack5
删了依赖和 lock file 然后重装

@chen-mu
Copy link

chen-mu commented Jul 1, 2021

请问这个问题最后怎么解决的,我这边也是老项目,不知道怎么就装了一个webpack5+的依赖

@chen-mu
Copy link

chen-mu commented Jul 1, 2021

我这最后的解决方案是在package.json文件中写死webpack版本

@Niubility-SunLight
Copy link

我这边因为打包scss使用了/* autoprefixer: ignore next */ -webkit-box-orient: vertical; 导致build不通过,只能把这个属性通过行内样式写入

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

4 participants