# Async/await no plugin: funciona na instância de dev, não na instância do Docker

**URL:** <https://meta.discourse.org/t/async-await-in-plugin-works-in-dev-instance-not-in-docker-instance/82363>\
**Category:** Development\
**Created:** [6 Março , 2018 22:23 UTC](https://meta.discourse.org/t/async-await-in-plugin-works-in-dev-instance-not-in-docker-instance/82363 "2018-03-06T22:23:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)\
**Post date:** [6 Março , 2018 22:23 UTC](https://meta.discourse.org/t/async-await-in-plugin-works-in-dev-instance-not-in-docker-instance/82363/1 "2018-03-06T22:23:29Z")

</div>

I get this error when installing a plugin in a docker instance:

```plaintext
Compressing: plugin-third-party-ea46d31326df4fb4ed1d79ef5ecad5179b0512d15492b09e348b67b027cced32.js
uglifyjs '/var/www/discourse/public/assets/_plugin-third-party-ea46d31326df4fb4ed1d79ef5ecad5179b0512d15492b09e348b67b027cced32.js' -p relative -c -m -o '/var/www/discourse/public/assets/plugin-third-party-ea46d31326df4fb4ed1d79ef5ecad5179b0512d15492b09e348b67b027cced32.js' --source-map-root '/assets' --source-map '/var/www/discourse/public/assets/plugin-third-party-ea46d31326df4fb4ed1d79ef5ecad5179b0512d15492b09e348b67b027cced32.js.map' --source-map-url '/assets/plugin-third-party-ea46d31326df4fb4ed1d79ef5ecad5179b0512d15492b09e348b67b027cced32.js.map'
Parse error at _plugin-third-party-ea46d31326df4fb4ed1d79ef5ecad5179b0512d15492b09e348b67b027cced32.js:637,7
	async function onEvent(container, event) {
	      ^
SyntaxError: Unexpected token: keyword (function)
    at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:86:23)
    at /usr/lib/node_modules/uglify-js/bin/uglifyjs:384:40
    at time_it (/usr/lib/node_modules/uglify-js/bin/uglifyjs:620:15)
    at /usr/lib/node_modules/uglify-js/bin/uglifyjs:345:9
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

```

Removing async/await fixes the issue. It looks like some es6 code is sent to `uglifyjs` before conversion to es5.

The error doesn’t always occur. A few days ago, I retried installing several times and it finally succeeded. But now I’m stuck again.

---

_[View the full topic](https://meta.discourse.org/t/async-await-in-plugin-works-in-dev-instance-not-in-docker-instance/82363)._
