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
@mgorodetski, Hi!
Can you show the error output and code?
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
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
).
Are you using typescript?
Are you using typescript?
Nope, js
Can you show the contents of package.json
?
Does the error show up after starting the bot or only in VS Code itself?
in VS Code itself. Just ignore that?
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.
Спасибо за твой труд и за объяснения!
Glad to help, @mgorodetski)