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

taro 2.2.15 打包构建报错 #9044

Closed
jeft224 opened this issue Apr 7, 2021 · 1 comment
Closed

taro 2.2.15 打包构建报错 #9044

jeft224 opened this issue Apr 7, 2021 · 1 comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x

Comments

@jeft224
Copy link

jeft224 commented Apr 7, 2021

相关平台

H5

浏览器版本: Google Chrome 88.0.4324.182
使用框架: React

复现步骤

taro cli版本升级至 2.2.15
npm run build:h5

期望结果

打包成功

实际结果

👽 Taro v2.2.15
(node:4688) UnhandledPromiseRejectionWarning: Error: Cannot find module 'core-js/modules/es.string.replace.js'
Require stack:

  • D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\node_modules\csso-webpack-plugin\lib\index.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\dist\util\chain.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\dist\config\dev.conf.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\dist\index.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\index.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\helper\dist\npm.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\helper\dist\index.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\helper\index.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\cli\dist\util\index.js
  • D:\codes\work\user\taro-user\node_modules@tarojs\cli\bin\taro
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\node_modules\csso-webpack-plugin\lib\index.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module._compile (D:\codes\work\user\taro-user\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Object.newLoader [as .js] (D:\codes\work\user\taro-user\node_modules\pirates\lib\index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (D:\codes\work\user\taro-user\node_modules@tarojs\webpack-runner\dist\util\chain.js:5:31)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module._compile (D:\codes\work\user\taro-user\node_modules\pirates\lib\index.js:99:24)
    (node:4688) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
    (node:4688) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    Done in 12.00s.

环境信息

� Taro v2.2.15


  Taro CLI 2.2.15 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x labels Apr 7, 2021
@jeft224
Copy link
Author

jeft224 commented Apr 7, 2021

主要的问题原因是:插件csso-webpack-plugin 插件依赖core-js,临时的解决方案是需要在项目中安装core-js (最好是最新版的);关于插件csso-webpack-plugin 那边也有issue 说明了这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x
Projects
Archived in project
Development

No branches or pull requests

2 participants