Приложение не работает с использованием Polymer и Angular 4 - PullRequest
0 голосов
/ 10 сентября 2018

Я недавно обновил свое угловое приложение с 2.0.1 до 4.0.0. Приложение работает, но не отображается в браузере. Кажется, ошибки указывают на проблему с полимером. Я пытался обновить зависимости bower, но все еще получал ошибки, подобные следующим:

Uncaught TypeError: Cannot read property 'calendar' of undefined
    at HTMLElement.ready (paper-date-picker.html:298)
    at HTMLElement._readySelf (polymer-mini.html:165)
    at HTMLElement._ready (polymer-mini.html:145)
    at HTMLElement._tryReady (polymer-mini.html:130)
    at HTMLElement._initFeatures (polymer.html:4222)
    at HTMLElement.__initialize (polymer-micro.html:235)
    at HTMLElement.createdCallback (polymer-micro.html:218)
    at ZoneDelegate.invoke (zone.js:365)
    at Zone.runGuarded (zone.js:138)
    at HTMLElement.createdCallback (zone.js:116)
ready @ paper-date-picker.html:298
_readySelf @ polymer-mini.html:165
_ready @ polymer-mini.html:145
_tryReady @ polymer-mini.html:130
_initFeatures @ polymer.html:4222
__initialize @ polymer-micro.html:235
createdCallback @ polymer-micro.html:218
ZoneDelegate.invoke @ zone.js:365
Zone.runGuarded @ zone.js:138
(anonymous) @ zone.js:116
hardware.js:42 Uncaught TypeError: Cannot read property 'appendChild' of null
    at errorLog (hardware.js:42)
errorLog @ hardware.js:42
error (async)
(anonymous) @ hardware.js:27
5polymer-micro.html:764 Polymer::Attributes: couldn`t decode Array as JSON
deserialize @ polymer-micro.html:764
_setAttributeToProperty @ polymer-micro.html:725
_takeAttributesToModel @ polymer-micro.html:714
_marshalAttributes @ polymer.html:1981
_initFeatures @ polymer.html:4221
__initialize @ polymer-micro.html:235
createdCallback @ polymer-micro.html:218
ZoneDelegate.invoke @ zone.js:365
Zone.runGuarded @ zone.js:138
(anonymous) @ zone.js:116
iron-list.html:964 iron-list requires a template to be provided in light-dom
_ensureTemplatized @ iron-list.html:964
_createPool @ iron-list.html:851
_itemsChanged @ iron-list.html:1072
_complexObserverEffect @ polymer.html:1626
_effectEffects @ polymer.html:1461
_propertySetter @ polymer.html:1445
__setProperty @ polymer.html:1454
_applyConfig @ polymer.html:2067
_afterClientsReady @ polymer.html:2061
_ready @ polymer-mini.html:144
_tryReady @ polymer-mini.html:130
_initFeatures @ polymer.html:4222
__initialize @ polymer-micro.html:235
createdCallback @ polymer-micro.html:218
ZoneDelegate.invoke @ zone.js:365
Zone.runGuarded @ zone.js:138
(anonymous) @ zone.js:116
HtmlBridgeMock.js:17 [Mock wrapper] LOG: |FRONTEND| |JAVASCRIPT ERROR| Uncaught TypeError: this.ctor is not a constructor
HtmlBridgeMock.js:17 [Mock wrapper] LOG: |FRONTEND| |JAVASCRIPT ERROR| @url http://localhost:9080/node_modules/zone.js/dist/zone.js
HtmlBridgeMock.js:17 [Mock wrapper] LOG: |FRONTEND| |JAVASCRIPT ERROR| @lineNumber 142
zone.js:142 Uncaught TypeError: this.ctor is not a constructor
    at HTMLElement.stamp (polymer.html:4605)
    at HTMLElement._createPool (iron-list.html:854)
    at HTMLElement._itemsChanged (iron-list.html:1072)
    at HTMLElement._complexObserverEffect (polymer.html:1626)
    at HTMLElement._effectEffects (polymer.html:1461)
    at HTMLElement._propertySetter (polymer.html:1445)
    at HTMLElement.__setProperty (polymer.html:1454)
    at HTMLElement._applyConfig (polymer.html:2067)
    at HTMLElement._afterClientsReady (polymer.html:2061)
    at HTMLElement._ready (polymer-mini.html:144)
    at HTMLElement._tryReady (polymer-mini.html:130)
    at HTMLElement._initFeatures (polymer.html:4222)
    at HTMLElement.__initialize (polymer-micro.html:235)
    at HTMLElement.createdCallback (polymer-micro.html:218)
    at ZoneDelegate.invoke (zone.js:365)

Версия зависимостей бауэра:

    "paper-card": "PolymerElements/paper-card#1.0.9",
    "iron-list": "PolymerElements/iron-list#1.3.7",
    "iron-scroll-threshold": "PolymerElements/iron-scroll-threshold#1.0.1",
    "paper-radio-group": "PolymerElements/paper-radio-group#1.0.9",
    "iron-selector": "PolymerElements/iron-selector#1.0.8",
    "paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#1.1.2",
    "paper-listbox": "polymerelements/paper-listbox#1.1.0",
    "iron-icon": "PolymerElements/iron-icon#1.0.7",
    "iron-icons": "PolymerElements/iron-icons#1.0.6",
    "paper-input": "PolymerElements/paper-input#1.1.5",
    "paper-ripple": "PolymerElements/paper-ripple#1.0.5",
    "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#1.1.1",
    "paper-fab": "PolymerElements/paper-fab#1.1.2",
    "paper-toolbar": "PolymerElements/paper-toolbar#1.1.2",
    "paper-tabs": "PolymerElements/paper-tabs#1.2.5",
    "paper-icon-button": "PolymerElements/paper-icon-button#1.0.6",
    "paper-button": "PolymerElements/paper-button#1.0.11",
    "iron-form": "PolymerElements/iron-form#1.0.13",
    "iron-pages": "PolymerElements/iron-pages#1.0.5",
    "iron-flex-layout": "PolymerElements/iron-flex-layout#1.2.2",
    "paper-header-panel": "PolymerElements/paper-header-panel#1.1.2",
    "paper-styles": "PolymerElements/paper-styles#1.1.2",
    "paper-radio-button": "PolymerElements/paper-radio-button#1.0.12",
    "paper-checkbox": "PolymerElements/paper-checkbox#1.1.0",
    "paper-item": "PolymerElements/paper-item#1.1.3",
    "paper-menu": "PolymerElements/paper-menu#1.2.2",
    "paper-dialog": "PolymerElements/paper-dialog#1.0.4",
    "moment": "2.11.1",
    "paper-date-picker": "polymer-paper-datepicker#1.1.2",
    "moment-element": "bendavis78/moment-element#1.1.0",
    "iron-image": "PolymerElements/iron-image#1.2.2",
    "neon-animation": "PolymerElements/neon-animation#1.2.4",
    "paper-progress": "PolymerElements/paper-progress#1.0.8",
    "iron-range-behavior": "PolymerElements/iron-range-behavior#1.0.4",
    "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#1.1.1",
    "iron-a11y-keys": "PolymerElements/iron-a11y-keys#1.0.4",
    "gold-email-input": "PolymerElements/gold-email-input#1.0.6",
    "gold-phone-input": "PolymerElements/gold-phone-input#1.0.7",
    "paper-select": "0.2.1",
    "i18n-msg": "1.0.3",
    "js-xlsx": "0.8.0",
    "alasql": "0.2.2",
    "paper-toast": "PolymerElements/paper-toast#1.1.3",
    "paper-drawer-panel": "PolymerElements/paper-drawer-panel#1.0.6",
    "paper-tooltip": "PolymerElements/paper-tooltip#1.1.2",
    "polymer": "1.2.4",
    "iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#1.1.1",
    "iron-media-query": "PolymerElements/iron-media-query#1.0.8",
    "prism-element": "PolymerElements/prism-element#1.1.0",
    "webcomponentsjs": "Polymer/webcomponentsjs#0.7.22",
    "iron-ajax": "PolymerElements/iron-ajax#1.2.0",
    "iron-dropdown": "PolymerElements/iron-dropdown#1.4.1",
    "paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#1.2.6",
    "paper-behaviors": "PolymerElements/paper-behaviors#1.0.11",
    "paper-menu-button": "PolymerElements/paper-menu-button#1.1.1",
    "iron-input": "PolymerElements/iron-input#1.0.10",
    "paper-material": "PolymerElements/paper-material#1.0.6",
    "iron-meta": "PolymerElements/iron-meta#1.1.1",
    "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#1.0.3",
    "iron-a11y-announcer": "PolymerElements/iron-a11y-announcer#1.0.4",
    "iron-scroll-target-behavior": "PolymerElements/iron-scroll-target-behavior#1.0.6",
    "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#1.0.12",
    "iron-behaviors": "PolymerElements/iron-behaviors#1.0.16",
    "iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#1.0.4",
    "iron-collapse": "PolymerElements/iron-collapse#1.0.8",
    "iron-fit-behavior": "PolymerElements/iron-fit-behavior#1.2.1",
    "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#1.0.6",
    "iron-menu-behavior": "PolymerElements/iron-menu-behavior#1.1.10",
    "iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#1.7.6",
    "iron-resizable": "PolymerElements/iron-resizable#1.0.3",
    "iron-iconset-svg": "PolymerElements/iron-iconset-svg#1.0.9"
  },
  "devDependencies": {
    "paper-datatable": "0.9.8",
    "alasql": "0.2.2"
  },
  "resolutions": {
    "paper-checkbox": "1.1.0",
    "paper-item": "1.1.3",
    "paper-styles": "1.1.2",
    "polymer": "1.11.3",
    "webcomponentsjs": "^0.7.24",
    "iron-resizable-behavior": "1.0.3",
    "paper-input": "^1.0.0"
  }
}

Приложение работало с любой проблемой, когда версия Angular была 2.0.1.

Кто-нибудь сталкивался с подобной проблемой?

1 Ответ

0 голосов
/ 11 сентября 2018

так что я нашел в чем проблема. Я следовал официальному руководству Angular, чтобы обновить версию Angular. В руководстве указано менять каждый тег по ng-шаблону. Я изменил шаблон моих полимерных элементов тоже, что неправильно. Мне нужно было сохранить шаблон.

...