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

Import as es6 module not working - could not find declaration file for module 'mongoose-intl' #39

Open
siddharth opened this issue Mar 23, 2022 · 0 comments

Comments

@siddharth
Copy link

siddharth commented Mar 23, 2022

I am trying to use this in express v4.16 on node v16.14.
I have setup express to use es6 syntax (and hence es6 imports for modules only, no require).

I am getting an error in one of my controllers :
TypeError: controllerName.setLanguage is not a function

This was functioning perfectly fine in a previous version of the same app which was not using es6 modules and was using the require('mongoose-intl') syntax.

This is how I am trying to import in app.js :
import mongooseIntl from 'mongoose-intl';

VS Code is giving the following hint in the import statement -

Could not find a declaration file for module 'mongoose-intl'.

Please help.

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