Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In latest Angular AOT mode Drag only moves the text inside... #56

Closed
born2net opened this issue Oct 13, 2019 · 2 comments
Closed

In latest Angular AOT mode Drag only moves the text inside... #56

born2net opened this issue Oct 13, 2019 · 2 comments
Assignees

Comments

@born2net
Copy link

@born2net born2net commented Oct 13, 2019

So I tested the project and it seems to be broken with AOT.
While it works fine in Angular CLI JIT mode, with AOT mode dragging only moves the text inside the frame.
You can check it out here:
http://secure.digitalsignage.com/pokes
enter anything for user/pass and click the resources on the left navigation tree.

here are my versions:

Angular CLI: 8.0.6
Node: 10.15.0
OS: win32 x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.2
@angular-devkit/build-angular      0.800.2
@angular-devkit/build-optimizer    0.800.2
@angular-devkit/build-webpack      0.800.2
@angular-devkit/core               8.0.2
@angular-devkit/schematics         8.0.6
@angular/cdk                       8.0.1
@angular/cli                       8.0.6
@angular/flex-layout               8.0.0-beta.26
@angular/http                      7.2.15
@angular/material                  8.0.1
@angular/material-moment-adapter   8.0.1
@ngtools/webpack                   8.0.2
@schematics/angular                8.0.6
@schematics/update                 0.800.6
rxjs                               6.4.0
typescript                         3.4.5
webpack                            4.30.0

and this is the error:

main-es2015.c07aaa5292bb6a22d65a.js:1 ERROR TypeError: this.setState is not a function
    at t.n.updateState (main-es2015.c07aaa5292bb6a22d65a.js:1)
    at t.n.updateRect (main-es2015.c07aaa5292bb6a22d65a.js:1)
    at t.n.updateTarget (main-es2015.c07aaa5292bb6a22d65a.js:1)
    at main-es2015.c07aaa5292bb6a22d65a.js:1
    at r.<computed> (main-es2015.c07aaa5292bb6a22d65a.js:1)
    at onDrag (main-es2015.c07aaa5292bb6a22d65a.js:1)
    at s.invokeTask (polyfills-es2015.0c0a6f8e1b4dd0704186.js:1)
    at Object.onInvokeTask (main-es2015.c07aaa5292bb6a22d65a.js:1)
    at s.invokeTask (polyfills-es2015.0c0a6f8e1b4dd0704186.js:1)
    at e.runTask (polyfills-es2015.0c0a6f8e1b4dd0704186.js:1)

Please let me know if there is anything else I can try?

Thanks,

Sean.

daybrush added a commit that referenced this issue Oct 13, 2019
daybrush added a commit that referenced this issue Oct 13, 2019
@daybrush

This comment has been minimized.

Copy link
Owner

@daybrush daybrush commented Oct 13, 2019

@born2net
Thank you for reporting bug.
Your example was very helpful in finding the cause.

ngx-moveable 0.5.4 version is released. Please check again.

You just need to update ngx-moveable.


The reason for the error

Angular aot and prod modes removed preact code.

// Angular aot and prod modes removed preact code.
extend(Component.prototype, {
        setState: function(state, callback) {
            if (!this.__s) this.__s = this.state;
            this.state = extend(extend({}, this.state), 'function' == typeof state ? state(this.state, this.props) : state);
            if (callback) this.__h.push(callback);
            enqueueRender(this);
        },
        forceUpdate: function(callback) {
            if (callback) this.__h.push(callback);
            renderComponent(this, 2);
        },
        render: function() {}
    });

So, update preact 8 => preactX

@daybrush daybrush self-assigned this Oct 13, 2019
@born2net

This comment has been minimized.

Copy link
Author

@born2net born2net commented Oct 14, 2019

great! fixed!

@born2net born2net closed this Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.