-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Broken in older versions of iOS Safari (v. 9.0) #68
Comments
I am a little confused, maybe you can help: ES6 modules can only run in an environment which supports ES6 (including things like I surely can change the ES6 module to use only ES5 code, but I would think that you can't get every developer of an ES6 module to use only ES5 code. Is there a particular reason that your build is not transforming code correctly for the browsers you are targeting? |
Yes, we are using AFIK Angular uses Webpack to build all our imports into a bundle. I don't believe it uses Babel at all. All of our Angular code is written in Typescript. AFIK the Angular CLI converts everything to Javascript to target ES6 and ES5 for all browser compatibility. I'm a little fuzzy on exactly what the Angular CLI is doing to achieve this, but all I know is 3rd party packages that are written for Angular such as js libraries:
ts libraries (Angular specific):
I believe this is due to the js libraries not being typed, and therefore not including a typed declaration file We haven't experienced the same bug that importing
I initially tried to resolve the issue by specifying that the code in
But this didn't work. Simply changing |
Okay, so looking around (I don't use Angular myself), I am finding that this is a known issue with the angular cli (angular/angular-cli#11892) and with webpack (webpack/webpack#6584). I am not seeing anyone mention a good solution here for using the Angular CLI in order to build third-party modules. What I am seeing a lot of people doing is using webpack directly rather than the Angular CLI. This lets you control how files are transformed, and allows you to transform all files for the target browsers, rather than only transforming ts files and leaving regular javascript as-is (really, I can't believe the Angular team thought that is how it is supposed to work). You could use |
remove es6 code form module, because angular 😔
This has been fixed in 0.4.1. I still highly encourage using a build which will properly transform code to for the desired target browsers. |
Broken in older versions of iOS Safari (and probably other browsers) that don't support ECMAScript 6 features such as
let
.Throws the following error:
I was able to fix this issue by simply changing 'let' to 'var' in
confetti.module.mjs
:OLD
NEW
The text was updated successfully, but these errors were encountered: