Open merlinstardust opened 8 years ago
It's likely caused by not using a transpiler to convert es2015 code into es5. The lib is setup to use babel in tandem with browserify via babelify, so if you use browserify to create a bundle, the transpiling should happen automatically.
I'm using Meteor which does the transpilation automatically.
I'm not familiar with how Meteor does its transcompiling or its builds, but it sounds like an issue on Meteor's end.
I was able to do the following with no problems:
babel src -d lib
in pixabayjs's root folder. That resulted in a lib folder where index.js
had the following code'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _lodash = require('lodash.assign');
var _lodash2 = _interopRequireDefault(_lodash);
...
exports.default = pixabayjs;
> var pixabay = require('./lib/index')
undefined
> pixabay
{ default:
{ _auth: {},
defaults: {},
authenticate: [Function: authenticate],
resultList: [Function: resultList] } }
>
It might be that we need to add a babel
config option in `package.json'. Perhaps try that to see if it resolves the issue, but without more details, it's likely a fault of meteor. If you figure a solution out, a PR is welcome.
Hi, I'm also getting this error. Is there any chance that you'll distribute transpiled es5 code ?
I'm also getting this error. Is there any chance that you'll distribute transpiled es5 code ?
We can look into doing a prepublish hook that would do that.
That would be cool :) .
I found also another bug (or feature), that pixabayjs
works on client and it doesn't have types (TS | Flow) :( , so I created my own implementation of pixabay API. You can look here https://github.com/dderevjanik/pixabay-api.
I found also another bug (or feature), that it only works on client and it doesn't have types (TS | Flow) :
Could you create new tickets for those? I'm not sure how likely we are to introduce types (but a pull would be welcome!), but it's something that can be discussed.
When I attemmpt to import pixabay, I get the following error.