-
Notifications
You must be signed in to change notification settings - Fork 136
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
opts.glob is not a function #381
Comments
If you set |
I have next tsconfig
So, it doesn't work with the type: "module" and ESModules in Node.js. I have the same problem with ESModules, but CommonJS works fine. I think this is due to the import of the fast-glob library. |
Can you create a small repro repository so I can debug this? |
I'm sorry, I won't be able to create the repository for about 9 hours. It also doesn't work with plain nodejs and esm modules. Can you check this import in awilix.module.mjs?
Update this import to default import resolve the problem
|
I've released an alpha build for you to try, please let me know if this works: |
Yes, everything is good. Can you also tell me how to use loadModules in TypeScript? What should I put in the glob paths? Compiled js files? |
That depends on your development and production setup. If you're using a module loader that supports |
I can't use loadModules with TypeScript because it throws the next error
awilix.module.mjs uses next imports:
However, the fast-glob and other modules have a namespace for export:
So, if we change the import statement from
import * as glob from 'fast-glob'
toimport glob from 'fast-glob'
, everything should work correctly.The text was updated successfully, but these errors were encountered: