Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Getting error after updating to 1.1.0 #3

Closed
bbashy opened this issue Oct 3, 2016 · 5 comments
Closed

Getting error after updating to 1.1.0 #3

bbashy opened this issue Oct 3, 2016 · 5 comments

Comments

@bbashy
Copy link

bbashy commented Oct 3, 2016

I have this

var Sticky = require('sticky-js');
var sticky = new Sticky('.sticky-item');

And it worked before updating but now it's throwing Cannot call a class as a function via sticky-compile.js

  function Sticky() {
    var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    _classCallCheck(this, Sticky); <-- line
@rgalus
Copy link
Owner

rgalus commented Oct 3, 2016

Hi @bbashy

Thanks for reporting the issue. Can you please tell me on what browser your are getting this error?

@bbashy
Copy link
Author

bbashy commented Oct 3, 2016

OS: macOS Sierra
Browser: Chrome: version 54.0.2840.41 beta (64-bit)
or
Browser: Safari: version 10.0 (12602.1.50.0.10)

I looked into it a bit more and it could be something with webpack. This is what got updated on npm

npm update

├── jquery@3.1.1
├── laravel-elixir-vue@0.1.8
├── lodash@4.16.2
├── sticky-js@1.1.0
└── vue@1.0.28

@rosswilson252
Copy link

rosswilson252 commented Oct 3, 2016

I can also confirm the same with Firefox 49.0.1.

With @bbashy mentioning webpack I've also just tried it with browserify as well and it's producing the same error.

@rgalus
Copy link
Owner

rgalus commented Oct 3, 2016

There was a conflict in exporting function. Fixed it by moving CommonJS export above AMD #bdc56ba.

Please update sticky-js to the newest version 1.1.1.

I've tested it with webpack & browserify and it works but it would be great if you could confirm me that it works for you too.

@bbashy
Copy link
Author

bbashy commented Oct 3, 2016

@rgalus Top work. Fixed. 👍

@rgalus rgalus closed this as completed Oct 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants