Relay: UglifyJs fails after upgrade to relay-runtime 10.0.0

Created on 14 Jul 2020  路  4Comments  路  Source: facebook/relay

After upgrading relay-runtime and relay-compiler from 9.1.0 to 10.0.0 I started to get the following error from UglifyJs:

ERROR in bundle.js from UglifyJs Unexpected token: operator 芦*禄, expected: punc 芦(禄 [./node_modules/relay-runtime/lib/store/RelayModernStore.js:639,0][bundle.js:56627,28]

Uglify is called from webpack config like so:

...
devtool: 'source-map',
plugins: [
    new UglifyJSPlugin({
        sourceMap: true
    }),
...

Any ideas / workarounds?

wontfix

Most helpful comment

Yup, you may have to transform the code to support outdated browsers.

All 4 comments

The file in question has a generator function which is somewhat newer syntax (been around a while though). You'll likely have to change whatever JS parser you're using to handle more recent syntax.

This is also causing problems in IE-11, since IE-11 does not support generator functions.

I have to transpile relay-runtime to make it work.

Yup, you may have to transform the code to support outdated browsers.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

derekdowling picture derekdowling  路  3Comments

rayronvictor picture rayronvictor  路  3Comments

bondanherumurti picture bondanherumurti  路  3Comments

jstejada picture jstejada  路  3Comments

johntran picture johntran  路  3Comments