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.

Error - Unexpected token: name (MockStorage)

See original GitHub issue

Hey, having this error when run npm run build -

ERROR in static/js/vendor.1d08fa61caa6133701c2.js from UglifyJs Unexpected token: name (MockStorage) [./node_modules/vuex-persist/dist/esm/index.js:6,0][static/js/vendor.1d08fa61caa6133701c2.js:32405,4]

vuex-persist version - ^1.7.2 vue version - ^2.5.15 vuex version - ^2.5.0

Using this package with localForage storage (local forage version - ^1.7.2)

Thanks !

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
connectedcommented, Feb 18, 2019

Possible solution is to use UMD module def. instead. import VuexPersist from 'vuex-persist/dist/umd'

1reaction
championswimmercommented, Oct 23, 2018

update to 1.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token: name (DocumentAttributes) with webpack ...
The problem here is with Uglify that cannot process ES6. I solved this problem by using uglifyjs-webpack-plugin instead.
Read more >
npm run build报错Unexpected token: name... - 简书
ERROR in static/js/vendor.86e2c6288e81323e1512.js from UglifyJs. Unexpected token: name (MockStorage) [./node_modules/vuex-persist/dist/esm/ ...
Read more >
webpack打包报错: name «MockStorage», expected: punc «;»
奈何失败的错误提示信息只有寥寥数语,根本无法定位到问题代码的位置ERROR in build.js from UglifyJs Unexpected token operator «=», expected punc «,» ...
Read more >
Build failed SyntaxError: Unexpected token: name (length)
In my case, i was using the vue truffle box and Uglify was the issue as it was the uglify that came with...
Read more >
How I Fixed: UglifyJs Unexpected token: name (DropIn)
As the error states, the issue is with the UglifyJs plugin, which I use in combination with WebPack. This is a frustrating show-stopping...
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