Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appear not defined #23

Open
vtvhunter opened this issue Nov 20, 2018 · 7 comments
Open

Appear not defined #23

vtvhunter opened this issue Nov 20, 2018 · 7 comments

Comments

@vtvhunter
Copy link

Hi,

We were using an earlier version of appear.js (1.0.3) and we were able to use it fine (called it using the sample code you provided on your website, appear({object content here})).
I tried a new project with the latest version and I am getting "appear is not defined" error inside Console. Do we need to assign it to a variable or another object and then execute it? Or does it has something to do with module imports/exports? Sorry, i'm not the most experienced person with JS but just noticed this and wanted to know if it had something to do with the way I was calling it or not.

Thanks

@jackmcdade
Copy link

Same issue here.

@philliphartin
Copy link

Also having the same issue.

@alexhisen
Copy link

This was introduced in the recent change to be compatible with webpack. The extra nested return function(obj) is not actually being executed, just defined, so this file no longer works to just load as a script in html.

@retailonline
Copy link

so this file no longer works to just load as a script in html.

So how do I load it into html so I can use it as before?

@cawecoy
Copy link

cawecoy commented Apr 6, 2019

Appear.js' example is not working.

<script src="http://localhost/js/appear.min.js"></script>
<script type="text/javascript">
var trackElementsViews = appear({
  init: function init(){
    console.log('dom is ready');
  },
  elements: function elements(){
    // work with all elements with the class "track"
    return document.getElementsByClassName('track');
  },
  appear: function appear(el){
    console.log('visible', el);
  },
  disappear: function disappear(el){
    console.log('no longer visible', el);
  },
  bounds: 200,
  reappear: true
});
</script>

Firefox console displays: ReferenceError: appear is not defined.

What can I do to solve this?

@cawecoy
Copy link

cawecoy commented Apr 6, 2019

Anyway, the older version (practically the same as the newer version) is working as I expect.

@trabdlkarim
Copy link

trabdlkarim commented Jul 18, 2021

For those still looking for a fix to this bug, there is an open pull request from @tehmi2000 that fixes it. It worked for me, you should get the updated code from here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants