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

webpack 4.46.0 配置terser-webpack-plugin后,npm run dev:weapp 报错,ReferenceError: _n88 is not defined, 无法启动。 #16266

Open
BugVSbug opened this issue Aug 7, 2024 · 0 comments
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@BugVSbug
Copy link

BugVSbug commented Aug 7, 2024

相关平台

微信小程序

复现仓库

git@172.26.29.181:business-invitation/business-invitation-mobile.git
小程序基础库: 3.4.10
使用框架: Vue 3

复现步骤

webpack4.46.0,taro 3.5.6。taro init初始化项目,在config 文件夹的index.js 的mini中配置terser-webpack-plugin,下载了terser-webpack-plugin 4的依赖
如下:
webpackChain: (chain, webpack) => {
chain.merge({
plugin: {
install: {
plugin: require('terser-webpack-plugin'),
args: [{
terserOptions: {
compress: true, // 默认使用terser压缩
keep_classnames: true, // 不改变class名称
keep_fnames: true // 不改变函数名称
}
}]
}
}
})
}

期望结果

项目顺利启动

实际结果

报错ReferenceError: _n88 is not defined,无法进入目标页面

环境信息

Taro CLI 3.5.6 environment info:
    System:
      OS: macOS 11.7.9
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v16.14.0/bin/yarn
      npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.6 => 3.5.6 
      @tarojs/components: 3.5.6 => 3.5.6 
      @tarojs/helper: 3.5.6 => 3.5.6 
      @tarojs/mini-runner: 3.5.6 => 3.5.6 
      @tarojs/plugin-framework-vue3: 3.5.6 => 3.5.6 
      @tarojs/plugin-platform-alipay: 3.5.6 => 3.5.6 
      @tarojs/plugin-platform-jd: 3.5.6 => 3.5.6 
      @tarojs/plugin-platform-qq: 3.5.6 => 3.5.6 
      @tarojs/plugin-platform-swan: 3.5.6 => 3.5.6 
      @tarojs/plugin-platform-tt: 3.5.6 => 3.5.6 
      @tarojs/plugin-platform-weapp: 3.5.6 => 3.5.6 
      @tarojs/router: 3.5.6 => 3.5.6 
      @tarojs/runtime: 3.5.6 => 3.5.6 
      @tarojs/shared: 3.5.6 => 3.5.6 
      @tarojs/taro: 3.5.6 => 3.5.6 
      @tarojs/taro-h5: 3.5.6 => 3.5.6 
      @tarojs/webpack-runner: 3.5.6 => 3.5.6 
      babel-preset-taro: 3.5.6 => 3.5.6 
      eslint-config-taro: 3.5.6 => 3.5.6 

补充信息

webpack 4.46.0
taro 3.5.6
terser-webpack-plugin 4.2.3

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 7, 2024
This was referenced Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Status: Todo
Development

No branches or pull requests

1 participant