VDS13/telegram-inline-calendar

Could not find a declaration file for module 'telegram-inline-calendar'.

mgorodetski opened this issue · 16 comments

I can't import 'telegram-inline-calendar' to my project properly as could not find a declaration file for module 'telegram-inline-calendar' . Tried both CommonJS and imports versions, also tried to declare module myself but it sisn't help

VDS13 commented

@mgorodetski, Hi!
Can you show the error output and code?

sure, this is import in my bot:
image
same issue at node-modules:
image

VDS13 commented

A few more questions:
What version of the package is used on the screenshots?
Is there a type: module parameter in package.json?
Have you edited node_modules yourself?

What version of the package is used on the screenshots? "telegram-inline-calendar": "^2.0.3"
Is there a type: module parameter in package.json? yes
Have you edited node_modules yourself? no, besides adding error output in th comment

VDS13 commented

The problem should be solved if in the second screen replace the line:

export {Calendar} from './src/Calendar.js';

In ESM, the file format must be specified explicitly during import/export (.js, .mjs).

VDS13 commented

It's just that if you look at the files of this version in npm, then the export is specified there correctly.
image
For some reason, the screenshot from node_modules is wrong.
image

Sorry, I forget I already tried it and didn't amend it back before replying to you above. Anyway it doesn't solve the problem:
image

VDS13 commented

Are you using typescript?

Are you using typescript?

Nope, js

VDS13 commented

Can you show the contents of package.json?

Can you show the contents of package.json?
Sure, here it is:
image

VDS13 commented

Does the error show up after starting the bot or only in VS Code itself?

in VS Code itself. Just ignore that?

VDS13 commented

VS Code throws this error because it uses TS. When starting the bot, there should be no problems. In the future I will release a release under TS.

Спасибо за твой труд и за объяснения!

VDS13 commented

Glad to help, @mgorodetski)