Skip to content

calling function in each other module is not working #2923

Description

@imVinayPandya

i have three files: is not working,
when i am running index.js file its giving me an error in file Test2.js TypeError: one.oneFunction is not a function

index.js File:

var test = require('./Test');
test.oneFunction(' from index ');

Test.js File:

var two = require('./Test2');
module.exports = {

    oneFunction: function(from) {
        two.twoFunction(' one ');
        console.log('function two from '+from);
    }
};

Test2.js File:

var one = require('./Test');
module.exports = {

    twoFunction: function(from) {
        one.oneFunction(' two ');
        console.log('function one from '+from);
    }
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions