-
Notifications
You must be signed in to change notification settings - Fork 987
Closed
Description
Operating System
macOS
Browser Version
Safari 16.5.2
Firebase SDK Version
10.1.0
Firebase SDK Product:
Auth
Describe your project's tooling
index.html with source tag.
Describe the problem
If the code raises an exception on initializeApp , the error is not caught on onLog. See the example HTML on the next section.
Steps and code to reproduce issue
<!DOCTYPE html>
<html lang='en'>
<head>
<title>Basic HTML5 document</title>
<meta charset='utf-8'>
</head>
<body>
<!-- Insert this script at the bottom of the HTML, but before you use any Firebase services -->
<script type="module">
import { initializeApp} from 'https://www.gstatic.com/firebasejs/10.1.0/firebase-app.js'
const firebaseConfig = {
//config
};
setLogLevel("verbose");
onLog(LogCallbackParams => {
console.log("error here");//never runs
console.log(LogCallbackParams));
});
// Initialize Firebase
try {
const app = initializeApp();//didn't provide config, get error
} catch(e) {
console.error(e);
console.error("catched error with try catch");//error is catched here, but not _onLog_
}
</script>
</body>
</html>