Jump to content
Search Community

Problem including morph svg in our solution

Mister Cheesecake test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

Hello,

At my work we have a greensock licence. We are trying to use the morph svg plugin. Since it is paid software I read that we can't refer to a cdn and we have to include it locally. We have included it in our solution but when we are trying to build our project the minifier throws a lot of errors that start with "Implicit property name must be identifier". There are a lot of errors. How do we resolve that? I can provide more information if required.

 

Here's an example of an error we get:

 

Implicit property name must be identifier: init(target, value, tween, index, targets) {
        if (!_checkRegister() || typeof(target.cssText) === "undefined") {
            return false;
        }
        let div = target._gsProxy = target._gsProxy || _doc.createElement("div");
        this.ss = target;
        this.style = div.style;
        div.style.cssText = target.cssText;

 

Thanks!

Link to comment
Share on other sites

  • Solution

You shouldn't need to process the GSAP files through your minifier.

I'm not sure what your project setup is like, but you can just pop the minified files (from the download available on your dashboard) on your server and then use a script tag, just like you would from the CDN.

 

Does that help?

Link to comment
Share on other sites

1 hour ago, Cassie said:

You shouldn't need to process the GSAP files through your minifier.

I'm not sure what your project setup is like, but you can just pop the minified files (from the download available on your dashboard) on your server and then use a script tag, just like you would from the CDN.

 

Does that help?

I think it does. I'll test it out and let you know. Do you happen to know if I have to registerPlugin for the  MorphSVGPlugin? I've seen samples on codepen where they don't do it and other samples that do.

Ex

gsap.registerPlugin(ScrollTrigger, MorphSVGPlugin);

 

Thanks!

  • Like 1
Link to comment
Share on other sites

It depends on your setup - If you're using the minified files they'll register themselves if they're loaded after the core GSAP file. If you're using a build tool that does tree shaking then you definitely have to register them.

Registering them doesn't hurt though so if in doubt, do in just in case.

Let us know how you get on!

Link to comment
Share on other sites

Yeah, that sounds like an issue with your minifier. Perhaps it doesn't support ES6 features or you're not using the UMD file(?). Like Cassie said, it's probably easiest to just use the already-minified files that we provide in our download zip. 

 

And yeah, registering the plugins is just a good habit to get into. It mainly for protecting against over-aggressive tree shaking in bundlers. 

Link to comment
Share on other sites

5 hours ago, Cassie said:

It depends on your setup - If you're using the minified files they'll register themselves if they're loaded after the core GSAP file. If you're using a build tool that does tree shaking then you definitely have to register them.

Registering them doesn't hurt though so if in doubt, do in just in case.

Let us know how you get on!

It worked thanks!!

Link to comment
Share on other sites

1 hour ago, GreenSock said:

Yeah, that sounds like an issue with your minifier. Perhaps it doesn't support ES6 features or you're not using the UMD file(?). Like Cassie said, it's probably easiest to just use the already-minified files that we provide in our download zip. 

 

And yeah, registering the plugins is just a good habit to get into. It mainly for protecting against over-aggressive tree shaking in bundlers. 

Yeah our solution is a .net mvc old solution. It's confusing to make things work at times. Also it's using require.js so that's another layer we need to worry about. Thanks for the help!!

  • Like 2
Link to comment
Share on other sites

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...