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

es5/client-legacy-bundle.js uses es6 syntax resulting in errors for older browsers #660

Open
rmi22186 opened this issue Oct 10, 2023 · 0 comments

Comments

@rmi22186
Copy link

rmi22186 commented Oct 10, 2023

V9.11.0 (latest as of 10/10/2023)

The es5 directory is advertised as containing builds of fetch-mock which do not use any JS syntax not included in the [ES5 standard](https://es5.github.io/), i.e. excludes recent additions to the language. However, es5/client-legacy-bundle.js contains references to const and let, which are part of es6 syntax. While this will still run fine in modern browsers, when I run automated cross browser testing, there are syntax errors for older browsers due to them not recognizing const/let/other es6 syntax - One example is FF30. I know this is an old browser, but it was just a test to see if it worked or not. This bundle should be pure ES5 as advertised.

In my case I am using Browserstack to test on older browsers. When I do a global find replace for const and let, and change these to var and re-run, it points out that there is a for/of error which is also es6 (for/in being es5). It seems perhaps babel requires some configuration to get the transpiling process to run properly.

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

1 participant