question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uglify complains SyntaxError

See original GitHub issue

我把vue-codemirror在自己项目中装好后,buld阶段报错:

ERROR in static/js/vendor.8de923185c435eea8019.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/.1.0.4@vue-codemirror/index.js:11,0]

有什么建议吗?

我的package.json中有配置babel相关的包:

{
  "name": "rsite",
  "version": "1.0.0",
  "description": "R浣撻獙鏁欏web鍓嶇",
  "author": "zchrissirhcz <zchrissirhcz@gmail.com>",
  "private": true,
  "scripts": {
    "dev": "node build/dev-server.js",
    "build": "node build/build.js",
    "test": "",
    "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
  },
  "dependencies": {
    "babel-runtime": "^6.0.0",
    "codemirror": "^5.19.0",
    "vue": "^1.0.21",
    "vue-paginate": "^2.1.2",
    "vue-resource": "^0.9.3",
    "vue-router": "^0.7.13",
    "vuex": "^1.0.0-rc.2",
    "whatwg-fetch": "^1.0.0"
  },
  "devDependencies": {
    "babel-core": "^6.0.0",
    "babel-eslint": "^6.1.2",
    "babel-loader": "^6.0.0",
    "babel-plugin-transform-runtime": "^6.0.0",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-stage-2": "^6.0.0",
    "babel-register": "^6.0.0",
    "connect-history-api-fallback": "^1.1.0",
    "css-loader": "^0.23.0",
    "eslint": "^2.10.2",
    "eslint-config-standard": "^5.1.0",
    "eslint-friendly-formatter": "^2.0.5",
    "eslint-loader": "^1.3.0",
    "eslint-plugin-html": "^1.3.0",
    "eslint-plugin-promise": "^1.0.8",
    "eslint-plugin-standard": "^1.3.2",
    "eventsource-polyfill": "^0.9.6",
    "express": "^4.13.3",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.8.4",
    "function-bind": "^1.0.2",
    "html-webpack-plugin": "^2.8.1",
    "http-proxy-middleware": "^0.12.0",
    "json-loader": "^0.5.4",
    "ora": "^0.2.0",
    "shelljs": "^0.6.0",
    "url-loader": "^0.5.7",
    "vue-codemirror": "^1.0.4",
    "vue-hot-reload-api": "^1.2.0",
    "vue-html-loader": "^1.0.0",
    "vue-loader": "^8.3.0",
    "vue-style-loader": "^1.0.0",
    "webpack": "^1.12.2",
    "webpack-dev-middleware": "^1.4.0",
    "webpack-hot-middleware": "^2.6.0",
    "webpack-merge": "^0.8.3"
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Rainboylvxcommented, Sep 24, 2016

我在build过程种,还是报错了SyntaxError: Unexpected token: operator (>) [./~/.1.0.4@vue-codemirror/es6.js

我把index 中 require(es6.js) 去掉后 就可以了

0reactions
surmon-chinacommented, Sep 24, 2016

已经修复,请更新

Read more comments on GitHub >

github_iconTop Results From Across the Web

prod for ng-cli results in UglifyJs SyntaxError: Unexpected ...
I discovered it was Autotrack by searching through the vendor.js file in the dist folder for the variable name that uglify was complaining...
Read more >
Transforming Async, Await JS and minifying using Uglify
The error in Safari I got looked like this: SyntaxError: Cannot declare a let variable twice: 'i'. Copy.
Read more >
Bug#983190: datatables.js: upstream versions >1.10.21 do not build ...
SyntaxError : Unexpected token: name (nav) at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/nodejs/uglify-js/tools/node.js:33:1), <anonymous>:84:23)
Read more >
Uglification Failed. Unexpected Character ' - ADocLib
it complains at the character:.The character is valid for the apple's JS framework.I can't see anything inside the uglify package to ignore those...
Read more >
Failed upgrade from v2.7.0.beta1 to v2.7.0.beta2 - general
<anonymous> (/usr/lib/node_modules/uglify-js/bin/uglifyjs:259:5) at Module. ... This is the section in the vendor js file it's complaining about:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found