Forum Discussion

sdudani's avatar
sdudani
Occasional Contributor
6 years ago

Error while Calling Script Routine from another Script Routine

Getting an error while calling routine from another routine. It gets executed but in the end I get this error. Tried with semicolon as well in the end. Same error.
  • cunderw's avatar
    6 years ago

    What does your export look like in the Login script? Are exporting the testLogin function?

  • tristaanogre's avatar
    tristaanogre
    6 years ago

    FYI, I tried something very simple.  I have one unit called "Login" that I did the following:

     

    function testLogin(){
        Log.Message('test login')
    }
    
    module.exports = Login

    I then created unit that looks like this

     

    var Login = require('Login');
    
    function test1(){
        Login.testLogin()
    }

    When I run test1 in that second unit, I get no error.  So... this tells me that there's something going on in the "Login" unit that you are exporting that we can't see.  Can you share all your code, please?

     

    Thanks.