question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interactions and observers not working with appfairy

See original GitHub issue

I wasn’t able to see any of my js scripts run on my pages when I ran the appfairy command. It seems like the issue was that appfairy renames all classes on the html files with “af-class-yourclass” so then the js file cannot attach to those after.

A quick workaround, a little time consuming but works:

Just search for selectors on bottom of webflow js file and add “af-class-” to them. i.e. “.thisClass” to “.af-class-thisClass”

They are all within these 2 initializer functions at the bottom of the Webflow generated script: Webflow.require(‘ix’).init(…)

Webflow.require(‘ix2’).init(…)

Also, I don’t know if its because I am rendering the pages on the server with NextJS, but I also had to add some attributes to my html tag for other animations to work correctly using: var doc = document.getElementsByTagName("html")[0] doc.setAttribute('data-wf-page', 'yourPageID') doc.setAttribute('data-wf-site', 'yourWebflowSiteID') //optional for language doc.setAttribute('lang', 'en')

Also, with nextJS I had to wrap these two initializer functions so they would only run on client side and not give me a “document not defined” when compiled on server using: $( document ).ready(function() {}

Hope this saves someone else a day of debugging!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
DAB0mBcommented, Nov 22, 2020

I’ve added native support for that in version 0.8.0. It will work out of the box now

2reactions
mackbdevcommented, Oct 25, 2019

How did this turn out?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
Gecko homopholis boivini, Remote control work trucks, Linux chinese english dictionary, ... La marzocco machine for sale, I quit match rey mysterio, ...
Read more >
Converting Webflow Site to React With Appfairy - Ultimate Guide
The problem. We went into webflow thinking it would be easy to move it over into the react project. We were very wrong....
Read more >
Untitled
Directvobsub not working windows 8, Papaccioli arredamenti! ... Ksiazkowe cytaty, Aperiodically meaning, Customized interactions llc, Kerala pachore recipe, ...
Read more >
Belfast's leading tech startups - The Guardian
Available drugs are good enough – the problem is that they're not smart enough. ... Last year, they released their first app, Fairy...
Read more >
Untitled
#matte Calorie cacahuete en coque, Atenolol interactions with herbs, ... Alcalde de catac ancash, Thandi ojeer wikipedia, Linux chown not working, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found