引入 "@tarojs/plugin-mini-ci": "^3.6.2" 编译失败

khbbv19g  于 2个月前  发布在  其他
关注(0)|答案(4)|浏览(36)

相关平台

微信小程序

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

复现步骤

common.wxss from CssoWebpackPlugin
You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
at runMicrotasks ()
at async Promise.all (index 0)
at async Promise.all (index 3)

期望结果

解决

实际结果

未解决

环境信息

👽 Taro v3.4.8

  Taro CLI 3.4.8 environment info:
    System:
      OS: macOS 13.0.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
      Yarn: 1.22.11 - /usr/local/bin/yarn
      npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.3.9 => 3.3.9 
      @tarojs/components: 3.3.9 => 3.3.9 
      @tarojs/mini-runner: 3.3.9 => 3.3.9 
      @tarojs/react: 3.3.9 => 3.3.9 
      @tarojs/runtime: 3.3.9 => 3.3.9 
      @tarojs/service: 3.3.9 => 3.3.9 
      @tarojs/taro: 3.3.9 => 3.3.9 
      @tarojs/webpack-runner: 3.3.9 => 3.3.9 
      babel-preset-taro: 3.3.9 => 3.3.9 
      eslint-config-taro: 3.3.9 => 3.3.9 
      react: ^17.0.0 => 17.0.2 
      taro-ui: ^3.0.0-alpha.10 => 3.0.0-alpha.10 
    npmGlobalPackages:
      typescript: 4.7.4
qlvxas9a

qlvxas9a2#

麻烦提供一个hello word 的最小demo, 密钥信息删除掉

dffbzjpn

dffbzjpn3#

node 版本16没有问题. 升级到18就有问题

owfi6suc

owfi6suc4#

node 版本16没有问题. 升级到18就有问题

可以参考 #11805 (comment) ,亲测有效。

config/prod.js:

module.exports = {
  env: {
    NODE_ENV: '"production"',
  },
  defineConstants: {},
  mini: {
    enableSourceMap: false,
    terser: {
      enable: true,
      config: {
        // 配置项同 https://github.com/terser/terser#minify-options
      },
    },
    csso: {
      enable: false,
      config: {
        // 配置项同 https://cssnano.co/docs/what-are-optimisations/
      },
    },
  },
  h5: {
    enableSourceMap: false,
    csso: {
      enable: false,
    },
  },
};

相关问题