Closed slavb18 closed 3 years ago
Trying to use loadModues with node v14.15.0 I have Application class:
import awilix from 'awilix'; import TestLogic from './core/TestLogic'; export default class Application { constructor() { this.container = awilix.createContainer(); const opts = { formatName: 'camelCase', esModules: true }; this.container.loadModules(['src/core/**/*.js'], opts); // this.container.register('testLogic', awilix.asClass(TestLogic)); } }
this.container.loadModules registers zero modules, see example project structure https://github.com/iconicompany/awilixexample
to reproduce error run test with npm run test
npm run test
You need to await loadModules when using esm
thank you Jeff!
Trying to use loadModues with node v14.15.0 I have Application class:
this.container.loadModules registers zero modules, see example project structure https://github.com/iconicompany/awilixexample
to reproduce error run test with
npm run test