-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 error when use type module on package.json #2217
Comments
Typescript tell you to use nodemon.default, but then when starting nodemon, node will throw an error as nodemon.default is not a function, so there is something wrong between types and export |
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
type: 'module' nodemon({ This expression is not callable. |
I don't know what that means. Can you provide a git repo to help understand and replicate (note that I don't generally use typescript so assume you'll have to be clear in your instructions) |
I understand, it's the same for me when I look at your project, I start coding using typescript and I never used module exports and stuff like that, so I really don't know how to help you, however, I think you know the difference between commonjs and esmodule. import statements of .js files are treated as ES modules if the nearest parent package.json contains "type": "module". Importing nodemon with type: module in a package.json will throw a typescript import error. This expression is not callable. I've seen that in the latest versions (I don't remember exactly which one) you include the @types in the repository, I strongly think that the error arises for that, however I'm not sure. I'm sorry but I have no time to provide a repro, however you can just create a new typescript project and use type: module on your package.json and the error will appear. |
Sorry, but I have just seen that there is a pull request that address this issue, |
I've just merged that pr. Since it was provided by someone else it didn't come with tests, so I can't be entirely sure it does what helps you, but hopefully it does the trick. |
I'l try it now and let you know if it does. |
Yes, it does fix the issue. |
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
Automatically closing this issue due to lack of activity |
This expression is not callable.
Type 'typeof import("/Users/simo97/Desktop/web/tiktok-downloader/node_modules/nodemon/index")' has no call signatures.ts(2349)
I'm using latest version but it happeng from 3.1.0, as no one has reported it before, I will do it.
The text was updated successfully, but these errors were encountered: