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

TypeError: Class constructor debugInfo cannot be invoked without 'new' #3591

Closed
eight04 opened this issue Jan 20, 2021 · 2 comments
Closed

Comments

@eight04
Copy link

eight04 commented Jan 20, 2021

debugInfo = getDebugInfo(context, this, tabSetStr);

Found this issue when trying to use less from the source. This works in dist because the class is compiled into a function.

@matthew-dean
Copy link
Member

I remember finding the same when trying to convert to TypeScript. I'm not sure what the resolution should be / was though.

@drdevlin
Copy link
Contributor

drdevlin commented Mar 5, 2021

Is there a reason that debugInfo is defined as a class? I think defining it as a function would resolve the issue. I have refactored it to a function locally and there's no regression (that is, all existing tests pass). If all this sounds right, I'm happy to make a PR. (This is literally my first comment on GitHub and would be my first PR.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants