Comments (5)
I manually installed @babel/plugin-transform-classes
, so babelrc is like
{
"plugins": [
"transform-classes",
["transform-builtin-classes", {
"globals": ["HTMLElement"]
}]
]
}
but no luck:
Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
from babel-plugin-transform-builtin-classes.
If you'd like to try seeing why it won't work in Meteor, it's really easy: just make a new Meteor project with the CLI,
meteor create foo
cd foo
# add above to .babelrc
npm i
npm i babel-plugin-transform-builtin-classes --save-dev
# write a custom elements and try to use it in the DOM, f.e. in main.js
meteor
and you'll get the error.
from babel-plugin-transform-builtin-classes.
Not sure where to start debugging this. I'd really like to get Custom Elements v1 working inside a Meteor app (i.e. using Meteor's build setup rather than transpiling them separately from the outside).
from babel-plugin-transform-builtin-classes.
babel 7 has my transformer included in core
my transformer works like this
{
"plugins": [
// either the preset es2015 or at least the following
"babel-plugin-transform-es2015-classes",
["babel-plugin-transform-builtin-classes", {
"globals": ["HTMLElement"]
}]
]
}
I don't know about the plugin "transform-classes" but I'm pretty sure it's not compatible with this transformer which works only with the Babel one.
If their "transform-classes" is special, I suggest you invert the transformation order.
I don't know otherwise how to help and since this made it into core I'm not really wasting too much time on this. PR welcome if you find a solution.
from babel-plugin-transform-builtin-classes.
Yep, just saw babel/babel#7020! :)
from babel-plugin-transform-builtin-classes.
Related Issues (14)
- IE11 "The custom element being constructed was not registered with 'customElements'" HOT 10
- It doesn't work in IE11 on windows 7 in combination with babel-polyfill HOT 7
- Not working with Node.js 8.9.0
- Not compatible with document-register-element for IE11 HOT 3
- Doesn't seem to work in Chrome v67 HOT 3
- path.inShadow not found (babel 7 support?) HOT 5
- _fixBabelExtend only injected upon first compile HOT 7
- Using babel-cli HOT 5
- Does not work with mixins HOT 8
- I'm using class factory mixins. HOT 14
- [feature request] support mixins HOT 4
- Providing a default set of native builtins? HOT 5
- Understanding when to use what. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-transform-builtin-classes.