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 BodyComponent cannot be invoked without 'new' #2149

Closed
btourman opened this issue Jan 22, 2021 · 5 comments
Closed

Comments

@btourman
Copy link

Hi everyone,

I'm developer on https://github.com/image-charts/mjml-chart

Recently I try to bump mjml-* dependencies from 4.7.1 to 4.8.1.
But when I run our tests, TypeError: Class constructor BodyComponent cannot be invoked without 'new' appears.
And I don't know why I have this error

Here is the component file https://github.com/image-charts/mjml-chart/blob/master/src/index.js

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/image-charts/mjml-chart
  2. Bump mjml-* to 4.8.1
  3. Run npm test
  4. See error

MJML environment (please complete the following information):

  • OS: MacOS Catalina
  • MJML Version 4.8.1
  • Node Version 14.15.1
  • NPM Version 6.14.8
@TrySound
Copy link
Contributor

TrySound commented Jan 22, 2021

Looks like it's because native class is trying to be extended by not native class. I guess we need to enable class transpilation back until v5 bump.

@iRyusa
Copy link
Member

iRyusa commented Jan 22, 2021

Do we have the same issue within the component boilerplate ?

@TrySound
Copy link
Contributor

What's "component boilerplate"?

@YasiOnFire
Copy link

Component boilerplate repo:
https://github.com/mjmlio/mjml-component-boilerplate

Same error for me for all my custom mjml components that are based on component boilerplate.

TrySound added a commit to TrySound/mjml that referenced this issue Feb 23, 2021
Ref mjmlio#2149

External packages rely on transpiled classes. We can disable
transpilation in major release.
@kmcb777
Copy link
Collaborator

kmcb777 commented Mar 2, 2021

Hi @btourman @YasiOnFire this should be fixed in the freshly released mjml 4.8.2

@kmcb777 kmcb777 closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants