Export to Wordpress Generates "Cannot read property 'frame' of undefined" error in Webflow

Hello Community,

Since Webflow CMS is not out yet :smile: I have had to resort to an alternative. In this case it is a Wordpress blog, and I have exported my Webflow content to place in it. When I do so, I now get three JavaScript exceptions that I did not have before:

Uncaught TypeError: Cannot read property 'frame' of undefined

I will get 1-3 of these depending on if the page is loading from a clean cache or not.

It appears to occur in Webflow._ in the webflow.js script. If you are interested in seeing this in action, you can visit this page here: http://blog.developers.win/?p=244&preview=1&_ppp=dd5d5d1de8

It seems as if this has to do with transitions/animations that were previously on my page. Is there a way to turn this functionality off while Webflow loads? Please let me know if there is anything I can do to fix/debug this problem. Even a link to a resource would be greatly appreciated!

Thank you for any assistance,
Michael

Hi @MikeEEE, I am not sure how much help it would be, but looking at this error in google search came up with this page and solution for another WP user: upload new image -> javascript error "Uncaught TypeError: Cannot read property 'frames' of undefined" Β· Issue #1 Β· hlashbrooke/WordPress-Plugin-Template Β· GitHub

Thank you for your reply @cyberdave. I have located the problem. The issue is that when Webflow exports, it assumes in some/most of its exported modules that β€œ$” is jQuery. In my particular case, my theme uses both jQuery and MooTools, and (naturally) MooTools has been given ownership to this symbol. I have gone through and added var $ = window.jQuery to the different modules and now I am running into other issues which I am currently trying to solve, but this appears to be the root of the problem. Would this be considered a bug worth reporting?

Hi @MikeEEE, I don’t think this would be a bug, unless you are getting this message on the site that is also published in Webflow without using MooTools being used or using custom code. We do not have support for custom code yet.

You will likely have to check the dependencies very carefully to make sure there is no conflict between jQuery and MooTools. This article may help: How to resolve the $ conflict between jQuery and mooTools? - Stack Overflow

I hope this helps !

Alright, i fixed the problem. I would say this is an issue with Webflow export generation, but I am not the expert here and will leave it to your discretion. :smile:

If you load this file:
http://blog.developers.win/wp-content/themes/treeson-pro/media/js/webflow.js?ver=1.0

You will see that line 3975 now reads:

var $ = window.jQuery;

However, it was generated as:

var $ = window.$;

Adjusting it to its current, deployed value fixed the issue. I would say that this is a bug, but once Webflow CMS emerges to smash the gooey crap out of Wordpress this will be a non-issue. :stuck_out_tongue:

1 Like

Hi @MikeEEE, it definitely sounds like strange behavior for sure ! If you export the site from webflow, without making any modifications to the exported code, do you get the errors?

If so, then there may be a bug there. Let me know if you can reproduce this on the clean exported site from Webflow, that way we can check if there is some problem with the export.

The β€œ$” is shorthand for the jQuery library that Webflow loads before the body. It might be causing an issue when you do the integration, but I would not consider this a bug.

Regards,
Dave

Correct, because in my (special) case my Wordpress theme is using MooTools, which is assigned to $ when that line of code executes. $.tram does not exist in MooTools, so it fails in my case when it is accessed.

The amount of people that will be facing this issue is negligible, so it is definitely an edge case, but it is something to be aware of, IMO. If anything, I hope this thread will serve as guidance for anyone else who encounters this issue in the future. From my perspective, I consider this resolved and need no further assistance. Thank you for your time and assistance, @cyberdave!

1 Like

Right on @MikeEEE, your points are for sure valid ! This is good info to keep around :slight_smile: Soon, with Webflow CMS, I am hoping you will never have to use WP again :slight_smile:

1 Like

Man you are right about that, @cyberdave! I just saw the video and it looks incredible! Webflow for life. I just wish it was possible to tie it into .NET technologies somehow, maybe as a .NET client designer. But alas C# and JavaScript are oil and water, hence the reason for my site (so we can get that changed). :smiley:

Hi Mike ! An API will be coming ! I do not have an ETA, pricing or feature specs, but when it arrives, it will open up new possibilities :slight_smile:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.