Typescript - TypeError telegraf_inline_menu_1.default is not a constructor
See original GitHub issueDescribe the bug This might not be a bug, but i encountered the following Type error while trying to instantiate this library. Pardon my light knowledge on typescript 😃.
Error message :
TypeError: telegraf_inline_menu_1.default is not a constructor
Versions Did you updated telegraf and telegraf-inline-menu to the latest version?
- Version of telegraf: 3.26.0
- Version of telegraf-inline-menu: 3.5.1
To Reproduce Steps to reproduce the behavior:
- ts-node --project tsconfig.json src/main.ts
Expected behavior There shouldn’t be any error from the import. I have yet to start utilising the telegrah-inline-menu capability.
Screenshots If applicable, add your specific code to help explain your problem.
import Telegraf from 'telegraf'
import TelegrafInlineMenu from 'telegraf-inline-menu'
const menu = new TelegrafInlineMenu('Main Menu')
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error: *.default is not a constructor - Stack Overflow
I get the following error, when testing some javascript code, transpiled from a typescript file. Here is the ...
Read more >TypeError: "x" is not a constructor - JavaScript - MDN Web Docs
The JavaScript exception "is not a constructor" occurs when there was an attempt to use an object or a variable as a constructor,...
Read more >Typescript Error - 'default.a is not a constructor'. #157 - GitHub
I am trying to get the json-editor alive and running with a simple Aurelia project. I can get the project to run successfully, ......
Read more >Resolving TypeError: "X" is Not a Constructor in JavaScript
JavaScript "TypeError: "x" is not a constructor" errors occur when invalid objects or a variable is erroneously used as a constructor.
Read more >"[Class] is not a constructor" error using JsonServiceClient
I am creating a React/Redux application using Typescript 2.1.4 and ES6 (using babel-polyfill and webpack). I get the following error when ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding
esModuleInterop
to your config solved it for me. But I do not fully understand why that is.https://www.typescriptlang.org/docs/handbook/compiler-options.html
God why js is such a shit