Open davidmaxwaterman opened 7 years ago
Hi @davidmaxwaterman, Have you solved this already and how? I'm not using polymer, just vanilla custom elements with React, but it's the same problem.
hi , i use 'polymer build' and it with the same problem; have you solved? it has troubled me for a long time ( ̄^ ̄)ゞ
https://github.com/sindresorhus/ponyfill solved it :)
Same problem here, using a webpack build with babel for my polymer web component. Problems arise when I configure babel to also target other browsers than Chrome. I.e. the following .babelrc config works:
{
"presets": [
[
"env", {
"targets": {
"browsers": [
"Chrome >= 52"
]
},
"useBuiltIns": true
}
],
"stage-1"
],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"syntax-class-properties"
]
}
whereas the next one causes the mentioned issue:
{
"presets": [
[
"env", {
"targets": {
"browsers": [
"Chrome >= 52",
"FireFox >= 44",
"Safari >= 7",
"Explorer 11"
]
},
"useBuiltIns": true
}
],
"stage-1"
],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"syntax-class-properties"
]
}
I have the same issue here. Has anyone ever solved this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Background:
I'm trying to switch from using
polymer build
to using a gulpfile based on the one from :https://github.com/PolymerElements/generator-polymer-init-custom-build
This is so I can add a version string into my app.
I have a slightly unsual app structure:
As mentioned, my gulpfile to build based on the custom psk build gulpfile, with some fixes shown in the following issue:
https://github.com/PolymerElements/generator-polymer-init-custom-build/issues/71
I have disabled bundling, as well as adding the code to add a version number - nothing of much consequence to this issue, I think.
If I put in console logs, the loading all seems to happen in the correct order, up until my-app is loaded, at which point, I get the error:
I find this problem is similar to the following, which @rictic mentions using
webcomponents-es5-loader.js
, but I don't have that file in webcomponentsjs :https://github.com/Polymer/polymer-cli/issues/601
and this problem is the same error message, though I'm not sure it is similar:
https://stackoverflow.com/questions/43520535/class-constructor-polymerelement-cannot-be-invoked-without-new
A suggestion in the above is to add custom-elements-es5-adapter.js (due to using webcomponents-loader.js), but I must already have that since it is in the call stack:
I was using
polymer serve
to serve mybuild/
directory, and one suggestion in the SO above suggests turning off the compile with--compile never
, which I am doing...so it hasn't made any difference.@justinfagnani requests cli version and ua string:
I hope someone can point me in the correct direction.
In the meantime, I'll attempt to turn the basic PSK-custom into a test case showing the same problem.