Please share more code so that we can take a look at the implementation. The screen shot of error is not helping much.
just by looking at the second image, it feel like the init function is within the require and you are trying to access it outside the require.