Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict mode causes error in Mobile Safari - iOS 9 #2

Closed
coleturner opened this issue May 19, 2017 · 1 comment
Closed

Strict mode causes error in Mobile Safari - iOS 9 #2

coleturner opened this issue May 19, 2017 · 1 comment

Comments

@coleturner
Copy link

SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.

Environment:

  • Webpack 1
  • Babel 6
  • React v15

When compiled, this package doesn't seem to be transformed.

You may want to consider transpiling the package or adding a notice that it is not compatible with ES6->ES5 transpiled environments.

Thanks for your time!

@saikojosh
Copy link
Owner

Hi @colepatrickturner,

I haven't tested for browser-based environments but you should be able to transpile to ES5.

You can tell Webpack/Babel to ignore everything in the node_modules directory except for Object-Assign-Deep by modifying the "exclude" option:

loaders: [{
  test: /\.jsx?$/,
  exclude: /node_modules\/(?!object-assign-deep)/,
  loader: 'babel',
  query: {
    presets: ['react', 'es2015']
  }
}],

Answer found here: babel/babel-loader#171

You'll also need to ensure the Babel plugins/presets you are using includes: transform-es2015-block-scoping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants