Broken login page for Webkit Browsers #7

Closed
opened 2022-06-29 18:01:29 +00:00 by ChaoticByte · 5 comments
ChaoticByte commented 2022-06-29 18:01:29 +00:00 (Migrated from gitlab.com)

An user reported that they weren't able to log in. They were using Safari (-> Webkit) on Mac OS. A quick look in the Browser Console showed an JavaScript ReferenceError.
I was able to reproduce the error in Epiphany Browser (also Webkit) on Linux.

This is the error message:

[Error] ReferenceError: Can't find variable: username_input
	set_username (login.js:55)
	(anonymous function) (login.js:36)
An user reported that they weren't able to log in. They were using Safari (-> Webkit) on Mac OS. A quick look in the Browser Console showed an JavaScript ReferenceError. I was able to reproduce the error in Epiphany Browser (also Webkit) on Linux. This is the error message: ``` [Error] ReferenceError: Can't find variable: username_input set_username (login.js:55) (anonymous function) (login.js:36) ```
ChaoticByte commented 2022-06-29 18:01:30 +00:00 (Migrated from gitlab.com)

assigned to @W13R

assigned to @W13R
ChaoticByte commented 2022-06-29 18:01:43 +00:00 (Migrated from gitlab.com)

It seems like this problem exists because I put all javascript code in login.js into an isolated scope to protect variables from global access.

I discovered that it works when I use

(() => {
    let variable1 = "...";
    // code
})()

(defining a function and immediately calling it)

instead of

{
    let variable1 = "...";
    // code
}

(defining a scope with curly braces)

This is stupid.

It seems like this problem exists because I put all javascript code in login.js into an isolated scope to protect variables from global access. I discovered that it works when I use ``` (() => { let variable1 = "..."; // code })() ``` (defining a function and immediately calling it) instead of ``` { let variable1 = "..."; // code } ``` (defining a scope with curly braces) This is stupid.
ChaoticByte commented 2022-06-29 18:05:37 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ChaoticByte commented 2022-06-29 18:06:51 +00:00 (Migrated from gitlab.com)

mentioned in commit 4fd02a8498

mentioned in commit 4fd02a84980025a780dfc069e85476907e97eb33
ChaoticByte commented 2022-06-29 18:09:09 +00:00 (Migrated from gitlab.com)

The mentioned commit (4fd02a84) fixes the issue for me.

The mentioned commit (4fd02a84) fixes the issue for me.
ChaoticByte (Migrated from gitlab.com) closed this issue 2022-06-29 18:10:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ChaoticByte/drinks-manager#7
No description provided.