kristianmandrup / bitbucket-api-v2

Bitbucket API v2 library
Other
10 stars 13 forks source link

TypeError: createBitbucketAPI is not a function #4

Closed HarisHashim closed 6 years ago

HarisHashim commented 6 years ago

I am getting

TypeError: createBitbucketAPI is not a function

When running in my development as well as Runkit. You can refer to the picture for the code

image

Thanks! Haris

kristianmandrup commented 6 years ago

Yes unfortunately. Just tried upgrading to Babel but got stuck. Configuration nightmare!

If you are unable to use ES 2015 modules, you might want to use the pre-compiled dist files:

const { createBitbucketAPI } = require('bitbucket-api-v2/dist/bitbucketAPI.min')

Updated Readme to reflect this. Ideally the project should be converted to TypeScript to avoid the babel/webpack configuration nightmare and have better IDE support to boot.

HarisHashim commented 6 years ago

Thanks, will give it a try

kristianmandrup commented 6 years ago

Cool :) Please let me know if it works for you. Lib was designed to be mostly used on the backend in a node.js environment.

nathanhinish commented 6 years ago

I was getting this also. Looking at the source code, I just had to capitalize the second 'b' in bitbucket.

createBitBucketAPI

kristianmandrup commented 6 years ago

Oh, sorry about that. I will fix the docs to reflect that. Thanks.

I've changed it to match the docs, so using it from node.js, it should work with createBitbucketAPI while I keep the deprecated factory name createBitBucketAPI for now. Published as 0.6.1 on npm.