Skip to content

Arrow functions are not being transpiled in production #1418

Closed
@gregblass

Description

@gregblass

I just launched my first production Rails app with webpacker. I wrote many of my JS functions using arrow notation, but then started getting errors being reported for users using IE11.

I assumed webpacker would handle this for me because it said 'ES6 with babel' under features on the readme.

I dove in a little bit to some of the issues on here, and one suggestion was to add import 'babel-polyfill' to app/javascript/packs/application.js - but that didn't seem to make any difference (unless I am doing something wrong).

In the meantime, I went back and converted all my arrow functions back to regular javascript functions since the code is in production, but I'd like to be able to use arrow functions in the future.

Is ES6 babel transpiling intended to work out of the box, or is there something I'm missing here that I need to do to get that to work? Furthermore, is there a gap in the documentation, or did I miss some key part?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions