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

WebPack 5 and old chrome (webview 38) #954

Closed
oreons opened this issue Mar 26, 2021 · 7 comments
Closed

WebPack 5 and old chrome (webview 38) #954

oreons opened this issue Mar 26, 2021 · 7 comments
Assignees
Labels
💥 Bug Something isn't working
Milestone

Comments

@oreons
Copy link

oreons commented Mar 26, 2021

Simple-keyboard version 3.0.0

Describe the bug
In webpack 5, to support older versions of browsers, necessary to include in webpack.config.js option: target: ["es5"].
Otherwise, webpack will use a new syntax in the final bundle (for example, the const keyword). Some older versions of chrome, such as 38, don't understand the new syntax and throw an error.
Unfortunately, these webview versions are still used in industrial devices running Android 4.1. When running program with keyboard module on such a device, the error "Uncaught SyntaxError: Use of const in strict mode."
You can read about it here: https://webpack.js.org/migrate/5/#need-to-support-an-older-browser-like-ie-11
If you need an old browser for the test, you can download it here: https://www.googleapis.com/download/storage/v1/b/chromium-browser-continuous/o/Win%2F288629%2Fchrome-win32.zip?generation=1407723831493000&alt=media

Image 1

@hodgef hodgef added the 🆗 Not a bug Issue that do not depict a bug within simple-keyboard label Mar 26, 2021
@hodgef
Copy link
Owner

hodgef commented Mar 26, 2021

Hey @oreons,

The demos site (hodgef.com/simple-keyboard) is not compatible with older browsers, because it's meant for devs.

However, the simple-keyboard library itself is compatible with older browsers.

You can run the following demo in an old supported browser (such as Internet Explorer 11) to verify:
https://hodgef.com/static/simple-keyboard-test-ie.html

Regards,
Francisco Hodge

@hodgef hodgef closed this as completed Mar 26, 2021
@oreons
Copy link
Author

oreons commented Mar 26, 2021

Thanks for the answer.
I tested the keyboard on a separate empty project of mine. The trouble is that this extremely unfortunate and buggy version of webview 38, which is installed on industrial terminals, works even worse than internet explorer 11. Chinese terminals cannot be updated to new versions of webview and I have to adjust the software to support them. I compiled the simple-keyboard project locally and if I don't add the target: ["es5"] option, it won't run on webview 38.
Image 2

@hodgef
Copy link
Owner

hodgef commented Mar 26, 2021

Oh! Sorry - I did use const in that IE demo. Just changed it to var. Could you try again?
https://hodgef.com/static/simple-keyboard-test-ie.html

Basically the main demos are all in es6+ so indeed if you're using them in your project you'll need to transpile to es5.

The simple-keyboard package should be compatible with the old browsers in this list. I don't think that covers Chromium 38 though (if that's what you're targeting).

Regards,
Francisco Hodge

@oreons
Copy link
Author

oreons commented Mar 26, 2021

There's also "let" in html)
But the first error is due const inside index.js
Image 3
Image 4

@hodgef
Copy link
Owner

hodgef commented Mar 26, 2021

Interesting... Thanks for the heads up!

@hodgef hodgef reopened this Mar 26, 2021
@hodgef hodgef added 💥 Bug Something isn't working and removed 🆗 Not a bug Issue that do not depict a bug within simple-keyboard labels Mar 26, 2021
hodgef added a commit that referenced this issue Mar 26, 2021
@hodgef hodgef added this to the 3.0.19 milestone Mar 26, 2021
@hodgef
Copy link
Owner

hodgef commented Mar 26, 2021

Hey @oreons,

This issue should be fixed in the newly published simple-keyboard@3.0.19. I've also updated the Internet Explorer demo.

Let me know if you're still having this issue!

Regards,
Francisco Hodge

@hodgef hodgef closed this as completed Mar 26, 2021
@oreons
Copy link
Author

oreons commented Mar 26, 2021

Thank you very much , now its works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants