Trying to launch my basic electron application, I utilize Typescript for development which then compiles into JavaScript. However, upon running the app, an error is encountered:
ReferenceError: exports is not defined[Learn More]
file:///Users/ahmet/Documents/JumbleUp-Desktop/dist/Login/Login.js:5
exports.__esModule = true;
The content of my login.ts file is as follows:
import firebase from "firebase";
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
location.replace("index.html");
} else {
location.replace("login.html");
}
});
function login() {
const userEmail = (document.getElementById("inputEmail") as HTMLInputElement).value;
const userPassword = (document.getElementById("inputPassword") as HTMLInputElement).value;
firebase.auth().createUserWithEmailAndPassword(userEmail, userPassword).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
window.alert("Alert : " + errorMessage);
});
}
Additionally, here is a glimpse of my tsconfig file:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"sourceMap": true,
"esModuleInterop": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": ["node_modules/*"]
}
},
"include": [
"src/**/*"
]
}