-
Notifications
You must be signed in to change notification settings - Fork 62
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
"Uncaught TypeError" when using slim-js with @babel/preset-env #89
Comments
All web components suffer from this, native or via library. |
If you are addressing modern browsers that support custom elements without polyfill, then you may want to ditch babel. Consider working with rollup targeted as es6 modules. |
Thanks for responding @eavichay . For anyone else who comes across this, the polyfill did not resolve this specific problem (although it will be needed for older browsers). I was getting the above error in browsers that support the web components specification. In order to use the latest
Since this fixes the eerror, I'll close this issue. Thanks again! 😄 |
If you wish to start fresh PWA project based on slim-js, with typescript support (optional), sass/HTML/image loading via import, type |
If I use
slim-js
and@babel/preset-env
in a webpack project, the resulting bundled code throws a console error:Uncaught TypeError: Class constructor Slim cannot be invoked without 'new'
.This is the slim code that is transpiled by Babel:
Please see the demo repository that reproduces the issue.
It's possible that this is related to babel/babel#9367, but I'm not sure. 🤷♀
The text was updated successfully, but these errors were encountered: