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

打包构建小程序报错@tarojs/redux-h5/dist/index.esm.js #4332

Closed
shiliangL opened this issue Aug 29, 2019 · 3 comments
Closed

打包构建小程序报错@tarojs/redux-h5/dist/index.esm.js #4332

shiliangL opened this issue Aug 29, 2019 · 3 comments

Comments

@shiliangL
Copy link

问题描述

打包构建小程序报错。提示定位node_modules/@tarojs/redux-h5/dist/index.esm.js报错如下

复现步骤
[复现问题的步骤]

  1. 初始化项目选择redux
  2. 打包小程序npm run build:weap
  3. 项目中有使用 taro-ui

如下 控制台输出

拷贝  NPM文件   dist/npm/nervjs/dist/index.js
拷贝  NPM文件   dist/npm/nervjs/index.js
拷贝  NPM文件   dist/npm/@tarojs/taro-h5/dist/index.cjs.js
错误  压缩错误  文件/Users/New/cube-taro-wechat-h5/node_modules/@tarojs/redux-h5/dist/index.esm.js
{ SyntaxError: Unexpected token: punc «{», expected: punc «;»
    at JS_Parse_Error.get (eval at <anonymous> (/Users/shiliangl/NewShiliangL/cube-taro-wechat-h5/node_modules/@tarojs/plugin-uglifyjs/node_modules/uglify-js/tools/node.js:20:1), <anonymous>:71:23)
    at formatError (internal/util/inspect.js:818:16)
    at formatRaw (internal/util/inspect.js:617:14)
    at formatValue (internal/util/inspect.js:509:10)
    at inspect (internal/util/inspect.js:189:10)
    at Object.formatWithOptions (util.js:84:12)
    at Console.(anonymous function) (console.js:191:15)
    at Console.log (console.js:202:31)
    at /Users/shiliangl/.config/yarn/global/node_modules/@tarojs/cli/dist/util/resolve_npm_files.js:357:33
    at Generator.next (<anonymous>)
  message: 'Unexpected token: punc «{», expected: punc «;»',
  filename: '0',
  line: 1,
  col: 7,
  pos: 7 }

系统信息
Taro CLI 1.3.15 environment info:
System:
OS: macOS Sierra 10.12.6
Shell: 5.2 - /bin/zsh
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.10.3 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: 1.3.15 => 1.3.15
@tarojs/components: 1.3.15 => 1.3.15
@tarojs/plugin-babel: 1.3.15 => 1.3.15
@tarojs/plugin-csso: 1.3.15 => 1.3.15
@tarojs/plugin-sass: 1.3.15 => 1.3.15
@tarojs/plugin-uglifyjs: 1.3.15 => 1.3.15
@tarojs/redux: 1.3.15 => 1.3.15
@tarojs/redux-h5: 1.3.15 => 1.3.15
@tarojs/router: 1.3.15 => 1.3.15
@tarojs/taro: 1.3.15 => 1.3.15
@tarojs/taro-alipay: 1.3.15 => 1.3.15
@tarojs/taro-h5: 1.3.15 => 1.3.15
@tarojs/taro-swan: 1.3.15 => 1.3.15
@tarojs/taro-tt: 1.3.15 => 1.3.15
@tarojs/taro-weapp: 1.3.15 => 1.3.15
@tarojs/webpack-runner: 1.3.15 => 1.3.15
eslint-config-taro: 1.3.15 => 1.3.15
eslint-plugin-taro: 1.3.15 => 1.3.15
nerv-devtools: ^1.4.0 => 1.4.4
nervjs: ^1.4.0 => 1.4.4
stylelint-config-taro-rn: 1.3.15 => 1.3.15
stylelint-taro-rn: 1.3.15 => 1.3.15

@taro-bot
Copy link

taro-bot bot commented Aug 29, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam
Copy link
Member

提供一个可以复现的 demo 吧

@Chen-jj
Copy link
Contributor

Chen-jj commented Jul 2, 2020

升级到最新版再试试吧。

@Chen-jj Chen-jj closed this as completed Jul 2, 2020
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