Jump to content
Search Community

Loopspeed

Business
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Loopspeed

  1. Cheers Blake it worked =]]

     

    For anyone else with the issue, this did the job:

     

      async componentDidMount() {
        if (typeof window !== "undefined") {
          import("../resources/animation/DrawSVGPlugin")
          import("pepjs")
        }
      }
    • Like 2
  2. Thanks for the quick response!

    I've seen your work, it's really impressive. Loving the grid with IO. 

     

    I've followed the Gatsby instructions for 'Fixing third-party modules' with no luck. 

     

    I'll see if I can get it to work with a conditional import.

  3. Hi everyone,

     

    I've successfully built with GSAP and Gatsby before, but not with the DrawSVGPlugin.

    It's throwing this error:

     

    Quote
    
    success Building production JavaScript and CSS bundles  3.648 s
    
    error Building static HTML failed
    
    See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html
    
      19 |     typeof window !== "undefined"
      20 |       ? window
    > 21 |       : _doc.defaultView || { getComputedStyle: function() {} },
         |              ^
      22 |   _getComputedStyle = function(e) {
      23 |     return _computedStyleScope.getComputedStyle(e) //to avoid errors in Microsoft Edge, we need to call getComputedStyle() from a specific scope, typically window.
      24 |   },
    
    
      WebpackError: TypeError: Cannot read property 'defaultView' of undefined
      
      - DrawSVGPlugin.js:21 Module../src/resources/animation/DrawSVGPlugin.js

     

     

    This seems to be a Gatsby build problem as it works fine with React. 

     

    Any ideas?

    Any suggestions would be hugely appreciated. 

     

    I've referenced the plugins like so: 

    const gsapPlugins = [DrawSVG, CSSPlugin, TweenLite]

     

    Thanks,

     

    Matt

×
×
  • Create New...