Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support require('foo') for /foo/index.js #132

Open
hthetiot opened this issue May 8, 2018 · 0 comments
Open

Support require('foo') for /foo/index.js #132

hthetiot opened this issue May 8, 2018 · 0 comments

Comments

@hthetiot
Copy link
Contributor

hthetiot commented May 8, 2018

Many node js library need to support this to run backend packages with mr.

APP_MAIN=data/main-data-coordinator.mjson node .

Examples:

var errors = require('lib/errors');
Error: Can't require module "lib/errors" via "lib/highLevelConsumer" because Cannot find module 'lib/errors'
    at getExports (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:594:29)
    at require (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:707:24)
    at Module.eval (file:///Users/hthetiot/projects/Kaazing/tmp/message/node_modules/kafka-node/lib/highLevelConsumer.js:8:14)
    at Module.module.factory (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/node.js:72:32)
    at Module.module.factory (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:1259:52)
    at getExports (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:632:38)
    at Module.require [as mappingRequire] (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:707:24)
    at getExports (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:610:31)
    at require (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:707:24)
    at Module.eval (file:///Users/hthetiot/projects/Kaazing/tmp/message/logic/service/kafka-service.js:5:25)
    at Module.module.factory (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/node.js:72:32)
    at Module.module.factory (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:1259:52)
    at getExports (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:632:38)
    at require (/Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:707:24)
    at /Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/node_modules/mr/require.js:716:28
Unhandled rejection Error: Error deserializing "root" when loading module "logic/service/kafka-service' from 'logic/service/kafka-service' cause: Can't require module "lib/assignment" via "lib/consumerGroup" because Cannot find module 'lib/assignment'
    at eval (file:///Users/hthetiot/projects/Kaazing/tmp/message/node_modulesv4/montage/core/serialization/deserializer/montage-reviver.js:483:27)
var dir = './lib/';
if (process.env.BUFFERMAKER_COVERAGE){
  dir = './lib-cov/';
}

module.exports = require(dir + 'BufferMaker');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant