Skip to content

calling function in each other module is not working #2923

@imVinayPandya

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);
    }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that look for answers.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions