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

Older versions of Edge showing error #13

Open
taylorbf opened this issue Mar 10, 2021 · 2 comments
Open

Older versions of Edge showing error #13

taylorbf opened this issue Mar 10, 2021 · 2 comments

Comments

@taylorbf
Copy link

Seeing this error when importing the package and running on pre-Chromium Edge.

SCRIPT: 1028: Expected identifier, string, or number

I see this error simply by importing, import TimeInputPolyfill from 'react-time-input-polyfill', even if I do not actually add the component to my layout.

It sounds like that error is due to inability of legacy Edge to read spread syntax. This doesn't make sense to me as I'd think your babel config would take care of that.

I noticed that I'm able to load your demo site -- dan503.github.io/react-time-input-polyfill/ -- on this same legacy version of Edge, without issue. Are you doing any extra compilation for that demo site?

Microsoft Edge 44.17763.1.0

React v. 16.13.1
React-time-input-polyfill v. 1.0.5

@Dan503
Copy link
Owner

Dan503 commented Mar 10, 2021

I think I've intentionally not used babel on the npm package because it is more efficient if your Babel compiles it along side the rest of your code to avoid extra babel functions getting generated.

@taylorbf
Copy link
Author

Would you consider it? That way your package works out of the box. In my experience it's common for projects to exclude node modules from their babel config, b/c we don't want to be compiling 100+ packages. In this case I exclude my node modules from babel and I'll need to write in a special exception to tell babel to compile this package only. It's OK but from my point of view as a user would rather have it compiled out of the box.

Thx btw, great package and dead useful in a tricky UI space

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