Skip to content

Events not working for Production builds #15

@alexgoldstone

Description

@alexgoldstone

Angular CLI: 6.2.2
Node: 8.11.3
OS: darwin x64
Angular: 6.1.1
Browser: Google Chromer Version 68.0.3440.106 (Official Build) (64-bit)

My <plotly-plot> component contains the following:

(hover)="handleHover($event)" (unhover)="handleUnhover($event)"

handleHover and handleUnhover simply console log the event.

If I run a development build using ng serve then everything functions correctly so it seems that in principle my code is fine.

If I create a production build using ng build --prod then the charts are still rendered correctly but my handleHover and handleUnhover functions do not get called and instead I see the following in the browser console:

main.f138b76c7351710df66b.js:1 ERROR TypeError: Cannot read property 'call' of undefined
    at main.f138b76c7351710df66b.js:1
    at a.emit (main.f138b76c7351710df66b.js:1)
    at HTMLDivElement.t.emit (main.f138b76c7351710df66b.js:1)
    at main.f138b76c7351710df66b.js:1
    at main.f138b76c7351710df66b.js:1
    at l (main.f138b76c7351710df66b.js:1)
    at Object.n.throttle (main.f138b76c7351710df66b.js:1)
    at Object.n.hover (main.f138b76c7351710df66b.js:1)
    at SVGRectElement.c.onmousemove [as __zone_symbol__ON_PROPERTYmousemove] (main.f138b76c7351710df66b.js:1)
    at SVGRectElement.S (polyfills.7a0e6866a34e280f48e7.js:1)
le @ main.f138b76c7351710df66b.js:1
t.handleError @ main.f138b76c7351710df66b.js:1
next @ main.f138b76c7351710df66b.js:1
e.object.i @ main.f138b76c7351710df66b.js:1
e.__tryOrUnsub @ main.f138b76c7351710df66b.js:1
e.next @ main.f138b76c7351710df66b.js:1
e._next @ main.f138b76c7351710df66b.js:1
e.next @ main.f138b76c7351710df66b.js:1
e.next @ main.f138b76c7351710df66b.js:1
e.emit @ main.f138b76c7351710df66b.js:1
(anonymous) @ main.f138b76c7351710df66b.js:1
e.invoke @ polyfills.7a0e6866a34e280f48e7.js:1
t.run @ polyfills.7a0e6866a34e280f48e7.js:1
t.runOutsideAngular @ main.f138b76c7351710df66b.js:1
onHandleError @ main.f138b76c7351710df66b.js:1
e.handleError @ polyfills.7a0e6866a34e280f48e7.js:1
t.runTask @ polyfills.7a0e6866a34e280f48e7.js:1
t.invokeTask @ polyfills.7a0e6866a34e280f48e7.js:1
_ @ polyfills.7a0e6866a34e280f48e7.js:1
m @ polyfills.7a0e6866a34e280f48e7.js:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions