I have two distinct constructors in my codebase: SignUp and GoogleSignIn. They are structured as follows:
import SignUp, {gapi_promise} from "./SignUp";
/**
*
* @param element
* @extends SignUp
* @constructor
*/
function GoogleSignIn(element){
SignUp.call(this);
}
GoogleSignIn.prototype = Object.create(SignUp.prototype);
export default GoogleSignIn;
Additionally,
function SignUp(){
//Some constructor code
}
export let gapi_promise = (function(){
return new Promise((resolve, reject) => {
//Perform some operations using the google API
});
}());
export default SignUp;
While attempting to bundle these assets with webpack and Babel loader, I encountered an error upon loading the page:
GoogleSignIn.js?1051**:21 Uncaught TypeError: Cannot read property 'prototype' of undefined(…)
The underlying issue seems to stem from the fact that the value of SignUp is undefined. Could it be caused by a mistake in how I am importing or exporting values?
The specific line causing the failure is:
GoogleSignIn.prototype = Object.create(SignUp.prototype);
If more information is needed to provide assistance, please do not hesitate to ask. Thank you for your help!