错误TypeError:context._applyGlobalCompositeOperation不是Konva js中的函数

时间:2018-09-27 06:43:43

标签: konvajs

使用Konva初始化图层时出现以下错误。

错误TypeError:context._applyGlobalCompositeOperation不是函数

我们有2个动画项目 1)我们捆绑了konva库,并在另一个项目中使用它,而不是通过npm安装。 2)现在我们创建了另一个项目,并在同一项目中使用它,但是这次我们在使用此软件包时通过npm安装了

现在,当我们在同一项目中的这两个页面(项目)之间导航时。我们正在解决上述问题。

有人可以帮助我们解决这个问题吗?

此处完整错误

ERROR TypeError: context._applyGlobalCompositeOperation is not a function
at Konva.Rect.drawScene (konva.js:9074)
at konva.js:8354
at Konva.Collection.each (livesportsvisualization.min.qTFK9r.js:29) **(its installed from bundled file which also have konva internally )**
at Konva.Layer._drawChildren (konva.js:8353) **( installed from NPM )**
at Konva.Layer.drawScene (livesportsvisualization.min.qTFK9r.js:44)
at Konva.Layer.drawScene (konva.js:11805)
at Konva.Layer.draw (konva.js:4504)
at Konva.Stage.add (konva.js:10837)
at Builder.drawBackground (basketball-animation.js:42)
at BasketBallComponent.drawBase (basketball-animation.js:2407)
at BasketBallComponent.ngAfterViewInit (basketball-animation.js:2440)
at callProviderLifecycles (core.js:12748)
at callElementProvidersLifecycles (core.js:12715)
at callLifecycleHooksChildrenFirst (core.js:12698)
at checkAndUpdateView (core.js:13853)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execEmbeddedViewsAction (core.js:14153)
at checkAndUpdateView (core.js:13845)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callViewAction (core.js:14195)
at execComponentViewsAction (core.js:14127)
at checkAndUpdateView (core.js:13850)
at callWithDebugContext (core.js:15098)
at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:14635)
at ViewRef_.detectChanges (core.js:11619)
at core.js:5918
at Array.forEach (<anonymous>)
at ApplicationRef.tick (core.js:5918)
at core.js:5751
at ZoneDelegate.3104.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:4760)
at ZoneDelegate.3104.ZoneDelegate.invoke (zone.js:387)
at Zone.3104.Zone.run (zone.js:138)
at NgZone.run (core.js:4577)
at Object.next (core.js:5751)
at SafeSubscriber.schedulerFn [as _next] (core.js:4342)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:242)
at SafeSubscriber.next (Subscriber.js:189)
at Subscriber._next (Subscriber.js:129)
at Subscriber.next (Subscriber.js:93)
at EventEmitter.Subject.next (Subject.js:55)
at EventEmitter.emit (core.js:4322)
at checkStable (core.js:4725)
at Object.onHasTask (core.js:4773)
at ZoneDelegate.3104.ZoneDelegate.hasTask (zone.js:441)
at ZoneDelegate.3104.ZoneDelegate._updateTaskCount (zone.js:461)
at Zone.3104.Zone._updateTaskCount (zone.js:285)
at Zone.3104.Zone.runTask (zone.js:205)
at drainMicroTaskQueue (zone.js:595)
at ZoneTask.3104.ZoneTask.invokeTask [as invoke] (zone.js:500)
at invokeTask (zone.js:1540)
at XMLHttpRequest.globalZoneAwareCallback (zone.js:1566)

谢谢, 斯里尼瓦斯。

0 个答案:

没有答案