Jump to content
Search Community

Cannot set property '_autoActivated' of undefined

colouredFunk test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm trying to deploy my Angular App but after running ng build --prod --base-href . I get the following error -

 

main.afc84290417a517dd6c3.js:1 Uncaught TypeError: Cannot set property _autoActivated' of undefined
    at Object.zUnb (main.afc84290417a517dd6c3.js:1)
    at p (runtime.a66f828dca56eeb90e02.js:1)
    at Object.5 (main.afc84290417a517dd6c3.js:1)
    at p (runtime.a66f828dca56eeb90e02.js:1)
    at n (runtime.a66f828dca56eeb90e02.js:1)
    at Array.e [as push] (runtime.a66f828dca56eeb90e02.js:1)
    at main.afc84290417a517dd6c3.js:1

 

Which seems to be related to TweenMax.JS

 

export const TweenMax = TweenMaxBase;
TweenMax._autoActivated = [TimelineLite, TimelineMax, CSSPlugin, AttrPlugin, BezierPlugin, RoundPropsPlugin, DirectionalRotationPlugin, Back, Elastic, Bounce, RoughEase, SlowMo, SteppedEase, Circ, Expo, Sine, ExpoScaleEase];

 

If I just run `ng build` it runs fine

 

Versions:

 

"@angular/animations": "^6.0.7",
    "@angular/cdk": "^6.3.1",
    "@angular/common": "^6.0.7",
    "@angular/compiler": "^6.0.7",
    "@angular/core": "^6.0.7",
    "@angular/forms": "^6.0.7",
    "@angular/http": "^6.0.7",
    "@angular/material": "^6.3.1",
    "@angular/platform-browser": "^6.0.7",
    "@angular/platform-browser-dynamic": "^6.0.7",
    "@angular/router": "^6.0.7",
    "@types/three": "^0.92.11",
    "core-js": "^2.5.4",
    "gsap": "^2.0.1",
    "hammerjs": "^2.0.8",
    "normalize-scss": "^7.0.1",
    "normalize.css": "^8.0.0",
    "rxjs": "^6.2.1",
    "three": "^0.87.1",
    "three-effectcomposer-es6": "0.0.4",
    "three-screen-quad": "^0.2.1",
    "zone.js": "^0.8.26"

 

Link to comment
Share on other sites

Hm, it sounds like a problem with your build system being too aggressive with tree-shaking. Maybe try referencing TweenMaxBase somewhere in your own code so that it doesn't get ripped out by tree shaking? 

import TweenMaxBase from "gsap/TweenMaxBase";
const activate = [TweenMaxBase];

 

It's tough to say without seeing your project, but it definitely sounds like over-aggressive tree shaking. 

Link to comment
Share on other sites

Can you provide a reduced test case with only the absolutely essential code to demonstrate the issue? (Like, literally, just a few lines - no need to include your whole app). I haven't heard any other reports of something like this, so I'm curious what's going on in your particular case. 

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...