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

React-spring > 8.0.5 stopped working in IE 11 #552

Closed
taikn opened this issue Feb 18, 2019 · 7 comments
Closed

React-spring > 8.0.5 stopped working in IE 11 #552

taikn opened this issue Feb 18, 2019 · 7 comments

Comments

@taikn
Copy link

taikn commented Feb 18, 2019

I am getting Syntax error in console which points to this line, probably due to defining variables with let
annotation 2019-02-18 100805

@jacobrask
Copy link
Contributor

The Common JS bundle should support IE11. Try updating your imports to

import { useSpring } from 'react-spring/web.cjs'

Or add a Webpack alias

  resolve: {
    alias: {
      'react-spring$': 'react-spring/web.cjs',
      'react-spring/renderprops$': 'react-spring/renderprops.cjs'
    },
  }

Not entirely sure but not ie11 has been in the babelrc config since very long ago so the fact that IE11 support broke in 8.0.5 could be due to unrelated changes making Rollup actually picking up the babel config properly for the default esm bundle.

@taikn
Copy link
Author

taikn commented Feb 18, 2019

Thanks, I also found a note in the docs about it!

@taikn taikn closed this as completed Feb 18, 2019
@ammmze
Copy link

ammmze commented Apr 23, 2019

oye...not ideal to import the commonjs module :\

Also FWIW the let is fine, its the arrow function on that line e=>"undefined"!=typeof window... that is causing the syntax error

@aleclarson
Copy link
Contributor

@ammmze fwiw, we'll eventually split each platform into its own package so that the .cjs extension is no longer needed.

@aleclarson
Copy link
Contributor

aleclarson commented Jun 25, 2019

Note: In the latest beta, you can import the platform-specific package if you don't like adding .cjs.js to every import statement:

import { useSpring } from '@react-spring/native'

For the web platform, you can actually import react-spring normally, because its main module is equal to the .cjs.js path already:

import { useSpring } from 'react-spring'

@Chetan-k Importing react-use-gesture/web.cjs.js is not necessary, because the main module of react-use-gesture is that path already (see here). Also, useSprings does not depend on react-use-gesture in any way.

@cr0cK
Copy link

cr0cK commented Jul 10, 2019

Unfortunately, the previous tricks don't work for me, my build is still broken for IE11. Only solution that I have found for now is to stick with 8.0.4...

@ricksmit3000
Copy link

unfortunatly didnt work for me either.

zebdelk added a commit to cedardevs/onestop that referenced this issue Oct 31, 2019
react-spring has a bug that breaks IE very very badly: pmndrs/react-spring#552, so downgrade to the version that doesn't have any issues.

Also changed the webpack hot-reload mechanism.
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

6 participants