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

error with 1.6.8 TypeError: _lory2.default is not a function #148

Closed
lalop opened this issue Dec 11, 2015 · 5 comments
Closed

error with 1.6.8 TypeError: _lory2.default is not a function #148

lalop opened this issue Dec 11, 2015 · 5 comments
Labels

Comments

@lalop
Copy link

lalop commented Dec 11, 2015

use lory in a webpack build and I get this error when I call lory(slider, {});
My code is only what is writen in the Readme.

It seems that _lory2 is due to webpack but I can't say more.

@lalop
Copy link
Author

lalop commented Dec 12, 2015

The error come from the import.
With import {lory} from 'lory.js'; it works

@lalop
Copy link
Author

lalop commented Dec 12, 2015

I'm not sure if it's the readme that needs to be updated or the export;

@meandmax meandmax added the bug label Dec 16, 2015
@meandmax
Copy link
Collaborator

Hey @lalop

I will look into this! Thanks for the report!

Max

@meandmax
Copy link
Collaborator

Babel 6 changes how it exports the default and the reason for this is actually valid es6. Everything before was incorrect behavior. So the solution here is to update the README (which I will do immediatly) and import lory as you already suggested.

Here the discussion: http://stackoverflow.com/questions/33505992/babel-6-changes-how-it-exports-default

So for es5/commonjs it will be:

var lory =  require('lory.js').lory

And for es6 it will be:

import {lory} from 'lory.js';

Any suggestions?

Max

@meandmax
Copy link
Collaborator

Have a look:

#150

@lalop lalop closed this as completed May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants