Static GitHub Issues

[924] Uglify error on build, but fine with dev?

prev: Trying to use Nuxt on top of a CMS API
next: Is it possible to setup test cases with zuul for nuxt project?

Hi guys,

I am sorry if this is duplicated or not. I tried to find another issue like this, but seems the issue is not the same or it just me who dont understand that.

Here's the repo https://github.com/muhajirframe/nuxt-openmultiurl

I got this error when i run yarn run dev

ERROR in 0.nuxt.bundle.a2aab161f7bb52fd8dfb.js from UglifyJs
Invalid assignment [./~/get-urls/index.js:5,0][0.nuxt.bundle.a2aab161f7bb52fd8dfb.js:800,29]

I did import get-urls at pages/index.vue. So i guess the problem was get-urls. And it depends on url-regex. So i try to use url-regex directly without get-urls. And then i got this error.

ERROR in 0.nuxt.bundle.d8de20ce0eb30c038791.js from UglifyJs
Unexpected token: operator (>) [./~/url-regex/index.js:5,0][0.nuxt.bundl
e.d8de20ce0eb30c038791.js:2990,23]

I guess the problem is that modules is written in es6. And it uses arrow function ( => ), The error said Unexpected operator (>) which is located at arrow function.

So how could be that modules transpiled with i am in development mode, and not transpiled in production.

Can anyone please help me?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c793">#c793</a>)</em></sub></div>