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

[Typescript] no exported member 'listModules' #76

Closed
TdyP opened this issue Jan 24, 2018 · 8 comments
Closed

[Typescript] no exported member 'listModules' #76

TdyP opened this issue Jan 24, 2018 · 8 comments
Labels

Comments

@TdyP
Copy link

TdyP commented Jan 24, 2018

Hi!
I would like to use Awilix in a Typescript project.
I'm trying to import the listModules function:

import {listModules} from 'awilix';

But getting an error:

src/DepsManager.ts(2,43): error TS2305: Module '"[....]/node_modules/awilix/lib/awilix"' has no exported member 'listModules'.

Is it a problem with my import or something missing in types declaration?

Thanks for your help! :)

@jeffijoe
Copy link
Owner

Thats odd, it should definitely be exported!

https://github.com/jeffijoe/awilix/blob/master/src/awilix.ts#L2

Are you sure you are using awilix@3?

@TdyP
Copy link
Author

TdyP commented Jan 24, 2018

yep, running [email protected]

awilix.d.ts :

export * from './errors';
export * from './container';
export * from './resolvers';
export * from './injection-mode';
export * from './lifetime';

No list-modules in it

@jeffijoe
Copy link
Owner

jeffijoe commented Jan 24, 2018

Wow, that's weird. I'll look into why that gets stripped out. In the meantime, you can import it from awilix/lib/list-modules.

@TdyP
Copy link
Author

TdyP commented Jan 24, 2018

OK
Importing from awilix/lib/list-modulesdoes make the job.

Thanks for your reactivity 👍

@jeffijoe
Copy link
Owner

I think I figured it out; The Rollup build is overwriting the typings, and the Rollup browser builds don't contain listModules. I'll see what I can do.

@jeffijoe
Copy link
Owner

@TdyP fixed in 3.0.4; this was a great catch, well done! Thanks for reporting! 👍

@TdyP
Copy link
Author

TdyP commented Jan 24, 2018

Issue fixed with a new release in 1 hour 🥇

Thanks, keep up the good work!

@jeffijoe
Copy link
Owner

No, thank you for using Awilix! 🚀

@jeffijoe jeffijoe added the bug label Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants