Skip to content

Production build does not work for Safari 10 due to Safari bug. Fix available. #3280

Closed

Description

@satyavh

There's a bug in Safari 10, it throws on uglified code
https://bugs.webkit.org/show_bug.cgi?id=171041

There's a fix as well, but Create React App does not implement the fix
https://github.com/mishoo/UglifyJS2/tree/harmony#mangle-options

The result is that it is very likely that a production build created by npm run build does not run on Safari. At least ours does not (mvp.giveth.io)

How to update the uglify settings?

Activity

  1. added a commit that references this issue on Oct 14, 2017
    eb3ec1c
  2. Timer commented on Oct 15, 2017

    @Timer
    Contributor

    I'm not sure I understand; Safari 10 throws on very specific minified code (based on the issue you linked).

    That specific code being a for (let a of ...) { ... }; we don't support minifying ES6 (i.e. let), so I don't understand how this flag would fix the error you are experiencing [because it can't happen in our setup].

    Could you please put together a minimal reproduction case?
    I'd like to understand this error more before flipping flags.

  3. Timer commented on Oct 15, 2017

    @Timer
    Contributor

    Are you ejected? What version of react-scripts are you on?

    Please follow the issue template.

  4. satyavh commented on Oct 16, 2017

    @satyavh
    ContributorAuthor

    No we didn't eject, but I got to the bottom of this and turns out we adjusted the react-script to support minifying ES6, by updating to "uglifyjs-webpack-plugin": "^1.0.0-beta.2"

    Closing this issue now. Sorry for the confusion.
    But now at least you know updating that plugin will break builds in Safari :-)

  5. added a commit that references this issue on Oct 28, 2017
    1fa16ac
  6. added a commit that references this issue on Oct 31, 2017
    1515ab4
  7. added a commit that references this issue on Jan 25, 2018
    7227b64
  8. added a commit that references this issue on Aug 14, 2018
    611df8f
  9. locked and limited conversation to collaborators on Jan 21, 2019
  10. added a commit that references this issue on Oct 8, 2024
    ff523ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions