KoteiIto / node-athena

a nodejs simple aws athena client
MIT License
105 stars 73 forks source link

Error - createClient is not a function #19

Closed Meenakshi14 closed 6 years ago

Meenakshi14 commented 6 years ago

Hi, on trying code I am getting the following error - createClient is not a function.

syntacticsolutions commented 6 years ago

What are you passing to the function? What code did you use to get the error?

isseu commented 6 years ago

I am using es6 and trying

import athena from 'athena-client';
const client = athena.createClient(clientConfig, awsConfig);

I get the same error. I solve it using:

import { createClient } from 'athena-client';
const client = createClient(clientConfig, awsConfig);

Buy it should be changed. This is because there is no default export

syntacticsolutions commented 6 years ago

use require instead of import.

`const Athena = require('athena-client')

var client = Athena.createClient(clientConfig, awsConfig)

On Jan 17, 2018 7:27 AM, "Enrique Correa" notifications@github.com wrote:

I am using es6 and trying

import athena from 'athena-client';const client = athena.createClient(clientConfig, awsConfig);

I get the same error. I solve it using:

import { createClient } from 'athena-client';const client = createClient(clientConfig, awsConfig);

Buy it should be changed. This is because there is no default export

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KoteiIto/node-athena/issues/19#issuecomment-358339402, or mute the thread https://github.com/notifications/unsubscribe-auth/ATPUSVO_gCtt-Z-7dK32-_YuThgPvuO9ks5tLhFpgaJpZM4Rci1T .

KoteiIto commented 6 years ago

Fixed it in version 2.2.0. Thank you.