You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Immediately invoking functions is supported, but what isn't is arrow functions.
Some people (us at k6 including) use babel to transpile our code down to what is supported by goja. We even only use the plugins for things that aren't supported ;) Note that we use babel 6.26.0, for ... reasons, but the latest versions seem to also work with goja.
We also have a template repository doing the transformation outside of k6. Which also uses webpack and babe,l which can possibly help you find which configurations will make webpack not emit arrow functions ;)
@patrickjm As @mstoykov said, arrow functions are not supported and you may want to consider using something like babel to transpile your code first. You might consider using the goja-babel package which uses the standalone version of babel running within goja to transpile code into something you could then run within goja.
Does Goja support these?
At the moment, this is what I'm getting:
Expected behavior
Webpack relies heavily on these to isolate modules (unless you set
output.iife: false
), so it would be very useful to see them supportedThe text was updated successfully, but these errors were encountered: