-
Notifications
You must be signed in to change notification settings - Fork 339
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
[3.0.1] Syntax error on IE11 #174
Comments
Try the following. webpack.config.jsSolution 1resolve: {
mainFields: ['browser', 'main', 'module'],
}, See Doc Solution 2Transpile with Babel
|
Is there a reason why v3 is not transpiled to ES5 anymore? It's a bit inconvenient having to configure build tools just for this library. |
Hello @sectsect |
I agree with @tu4mo that the current state of the package is not ideal for people who use tools like webpack. Ideally there would be a straightforward way to include both es5 and native code in a package such that build tools would have automatic options (based on target environments) to:
So far we are not even close to being there yet, and have to result to kludgy include/exclude hacks when something breaks. Until this changes, I'd recommend transpiling the primary output of the package to ES5. |
Related: #93 |
Hi David,
Thanks for your suggestion.
Would you mind creating a PR capturing this?
…On Sun, Apr 26, 2020, 5:27 AM Davison Long ***@***.***> wrote:
I agree with @tu4mo <https://github.com/tu4mo> that the current state of
the package is not ideal for people who use tools like webpack. Ideally
there would be a straightforward way to include both es5 and native code in
a package such that build tools would have automatic options (based on
target environments) to:
1. use the transpiled version for a given package
2. transpile the code for a given package
So far we are not even close to being there yet, and have to result to
kludgy include/exclude hacks when something breaks. Until this changes, I'd
recommend transpiling the primary output of the package to ES5.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJPCOXXYGIOPH7XZNAVFTLROM2QXANCNFSM4MQAYPZQ>
.
|
I agree that #172 improves the situation, and I guess there's not much more that can be done to make things easier on end users without reverting to only offering the transpiled code (which I agree is also not ideal). I don't know that I would call the situation fixed, however, when it takes tweaking webpack/babel settings to make things actually work. Because webpack prefers the |
@diachedelic Sorry, that's not correct. If that were true then my builds wouldn't be broken on IE11. If the I'm really not trying to be difficult--it simply won't work for older browsers as is unless your build system gets the right files, and webpack won't do that without a bunch of configuration. I suspect there isn't more reporting of the issue in this repo because most people don't deal with IE11 anymore (or aren't using a tool like webpack). Sadly some projects still have to deal with legacy browsers for at least a few more years. Obviously I would prefer to be using ES6 in general (and not having to transpile to ES5 at all), so I'm glad the ES6 code is included. However, anyone using a build tool and needing to transpile to ES5 for legacy browsers is going to have to do extra work with how things are now (specifically because the vast majority of babel configurations exclude node_modules). And it isn't as simple as just telling babel to transpile ALL node_modules code--that might work but then it will take ages to build the project every time (something the babel folks specifically warn against). |
Thanks guys. @firestar300 |
You are amazing guys ! Thank you all :) |
Hello !
I got this error en Internet Explorer 11 :
Syntax error
that point to :I use Babel to transpile ES6 code to ES5 with Webpack but it doesn't work for body-scroll-lock part so I don't know if it's an issue with BSL or Babel.
My
.babelrc
webpack.config :
Thanks for help.
The text was updated successfully, but these errors were encountered: