Chrome 63 for IOS throws error on javascript variable declarations with LET












0















I have a PWA app coded with PHP and JS. And it is working well on Chrome, Firefox, Edge and Opera on windows desktop. I also tried on Chrome for android, and it working as expected also.



But when i tried it on Ipad 2 with Chrome 63, i even couldn't login to my dashboard. When i used remote debugging, i realized that it throws error on Javascript variable declarations with let.



    let usr = $('#usrInput').val();
let pwd = $('#pwdInput').val();


When i changed them to var i finally logged in to my dashboard.



But the problem is, there are a lot of variable declarations with letand it is hard and also not correct to do so. I also use a lot of Javascript Libraries, which i assume are full of let declarations.



I also do not know what kind of problems (apart from variable declarations) will still occur, even i changed all let to var.



Is it all about a compatibility issue? Or am i missing something else?



UPDATE: I changed let variable declarations to var. And finally could log in. Here is the initial and most important error log:



app.js:217 Uncaught TypeError: Cannot read property 'userChoice' of undefined


Which is triggered from:



    var promtEvent;
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
localStorage.setItem("uygulamaYuklendimi", false);
btnAdd.removeAttribute("disabled", "");
btnAdd.innerText = 'Uygulamayı Yükle';
// Stash the event so it can be triggered later.
promtEvent = e;
// satinalmaKodu.style.display = 'block';
});

btnAdd.addEventListener('click', (e) => {
// hide our user interface that shows our A2HS button
$('#ayarlarModal').modal('hide');
$('#satinalmaKodu').collapse();
// Show the prompt
if(promtEvent) promtEvent.prompt();
// Wait for the user to respond to the prompt
promtEvent.userChoice
.then((choiceResult) => {
promtEvent = null;
});
});


I believe, chrome can't initialize beforeinstallprompt event, which is probably because of compatibility issue.



Is there a way, or some kind of library which includes this behaviour?




PS: Javascript is enabled on both Safari and Chrome for IOS.











share|improve this question

























  • Could you provide the logs?

    – abielita
    Nov 19 '18 at 14:29











  • @abielita I updated my question. Thx.

    – Rüzgar
    Nov 19 '18 at 19:31
















0















I have a PWA app coded with PHP and JS. And it is working well on Chrome, Firefox, Edge and Opera on windows desktop. I also tried on Chrome for android, and it working as expected also.



But when i tried it on Ipad 2 with Chrome 63, i even couldn't login to my dashboard. When i used remote debugging, i realized that it throws error on Javascript variable declarations with let.



    let usr = $('#usrInput').val();
let pwd = $('#pwdInput').val();


When i changed them to var i finally logged in to my dashboard.



But the problem is, there are a lot of variable declarations with letand it is hard and also not correct to do so. I also use a lot of Javascript Libraries, which i assume are full of let declarations.



I also do not know what kind of problems (apart from variable declarations) will still occur, even i changed all let to var.



Is it all about a compatibility issue? Or am i missing something else?



UPDATE: I changed let variable declarations to var. And finally could log in. Here is the initial and most important error log:



app.js:217 Uncaught TypeError: Cannot read property 'userChoice' of undefined


Which is triggered from:



    var promtEvent;
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
localStorage.setItem("uygulamaYuklendimi", false);
btnAdd.removeAttribute("disabled", "");
btnAdd.innerText = 'Uygulamayı Yükle';
// Stash the event so it can be triggered later.
promtEvent = e;
// satinalmaKodu.style.display = 'block';
});

btnAdd.addEventListener('click', (e) => {
// hide our user interface that shows our A2HS button
$('#ayarlarModal').modal('hide');
$('#satinalmaKodu').collapse();
// Show the prompt
if(promtEvent) promtEvent.prompt();
// Wait for the user to respond to the prompt
promtEvent.userChoice
.then((choiceResult) => {
promtEvent = null;
});
});


I believe, chrome can't initialize beforeinstallprompt event, which is probably because of compatibility issue.



Is there a way, or some kind of library which includes this behaviour?




PS: Javascript is enabled on both Safari and Chrome for IOS.











share|improve this question

























  • Could you provide the logs?

    – abielita
    Nov 19 '18 at 14:29











  • @abielita I updated my question. Thx.

    – Rüzgar
    Nov 19 '18 at 19:31














0












0








0








I have a PWA app coded with PHP and JS. And it is working well on Chrome, Firefox, Edge and Opera on windows desktop. I also tried on Chrome for android, and it working as expected also.



But when i tried it on Ipad 2 with Chrome 63, i even couldn't login to my dashboard. When i used remote debugging, i realized that it throws error on Javascript variable declarations with let.



    let usr = $('#usrInput').val();
let pwd = $('#pwdInput').val();


When i changed them to var i finally logged in to my dashboard.



But the problem is, there are a lot of variable declarations with letand it is hard and also not correct to do so. I also use a lot of Javascript Libraries, which i assume are full of let declarations.



I also do not know what kind of problems (apart from variable declarations) will still occur, even i changed all let to var.



Is it all about a compatibility issue? Or am i missing something else?



UPDATE: I changed let variable declarations to var. And finally could log in. Here is the initial and most important error log:



app.js:217 Uncaught TypeError: Cannot read property 'userChoice' of undefined


Which is triggered from:



    var promtEvent;
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
localStorage.setItem("uygulamaYuklendimi", false);
btnAdd.removeAttribute("disabled", "");
btnAdd.innerText = 'Uygulamayı Yükle';
// Stash the event so it can be triggered later.
promtEvent = e;
// satinalmaKodu.style.display = 'block';
});

btnAdd.addEventListener('click', (e) => {
// hide our user interface that shows our A2HS button
$('#ayarlarModal').modal('hide');
$('#satinalmaKodu').collapse();
// Show the prompt
if(promtEvent) promtEvent.prompt();
// Wait for the user to respond to the prompt
promtEvent.userChoice
.then((choiceResult) => {
promtEvent = null;
});
});


I believe, chrome can't initialize beforeinstallprompt event, which is probably because of compatibility issue.



Is there a way, or some kind of library which includes this behaviour?




PS: Javascript is enabled on both Safari and Chrome for IOS.











share|improve this question
















I have a PWA app coded with PHP and JS. And it is working well on Chrome, Firefox, Edge and Opera on windows desktop. I also tried on Chrome for android, and it working as expected also.



But when i tried it on Ipad 2 with Chrome 63, i even couldn't login to my dashboard. When i used remote debugging, i realized that it throws error on Javascript variable declarations with let.



    let usr = $('#usrInput').val();
let pwd = $('#pwdInput').val();


When i changed them to var i finally logged in to my dashboard.



But the problem is, there are a lot of variable declarations with letand it is hard and also not correct to do so. I also use a lot of Javascript Libraries, which i assume are full of let declarations.



I also do not know what kind of problems (apart from variable declarations) will still occur, even i changed all let to var.



Is it all about a compatibility issue? Or am i missing something else?



UPDATE: I changed let variable declarations to var. And finally could log in. Here is the initial and most important error log:



app.js:217 Uncaught TypeError: Cannot read property 'userChoice' of undefined


Which is triggered from:



    var promtEvent;
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
localStorage.setItem("uygulamaYuklendimi", false);
btnAdd.removeAttribute("disabled", "");
btnAdd.innerText = 'Uygulamayı Yükle';
// Stash the event so it can be triggered later.
promtEvent = e;
// satinalmaKodu.style.display = 'block';
});

btnAdd.addEventListener('click', (e) => {
// hide our user interface that shows our A2HS button
$('#ayarlarModal').modal('hide');
$('#satinalmaKodu').collapse();
// Show the prompt
if(promtEvent) promtEvent.prompt();
// Wait for the user to respond to the prompt
promtEvent.userChoice
.then((choiceResult) => {
promtEvent = null;
});
});


I believe, chrome can't initialize beforeinstallprompt event, which is probably because of compatibility issue.



Is there a way, or some kind of library which includes this behaviour?




PS: Javascript is enabled on both Safari and Chrome for IOS.








javascript ios cross-browser progressive-web-apps






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 19:58







Rüzgar

















asked Nov 19 '18 at 12:06









RüzgarRüzgar

751615




751615













  • Could you provide the logs?

    – abielita
    Nov 19 '18 at 14:29











  • @abielita I updated my question. Thx.

    – Rüzgar
    Nov 19 '18 at 19:31



















  • Could you provide the logs?

    – abielita
    Nov 19 '18 at 14:29











  • @abielita I updated my question. Thx.

    – Rüzgar
    Nov 19 '18 at 19:31

















Could you provide the logs?

– abielita
Nov 19 '18 at 14:29





Could you provide the logs?

– abielita
Nov 19 '18 at 14:29













@abielita I updated my question. Thx.

– Rüzgar
Nov 19 '18 at 19:31





@abielita I updated my question. Thx.

– Rüzgar
Nov 19 '18 at 19:31












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374304%2fchrome-63-for-ios-throws-error-on-javascript-variable-declarations-with-let%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374304%2fchrome-63-for-ios-throws-error-on-javascript-variable-declarations-with-let%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)