aws-sdk-js icon indicating copy to clipboard operation
aws-sdk-js copied to clipboard

AWS.CloudSearchDomain() is not working

Open EricYang opened this issue 12 years ago • 13 comments

var AWS = require('aws-sdk'); var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); csd.search(params, function (err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });

response: throw error: TypeError: undefined is not a function

EricYang avatar Sep 04 '14 09:09 EricYang

Which line is the error being thrown from? If you print err.stack from your callback it should print out a full stack trace.

I tried to run this in node and I am not able to reproduce any issue. Are you by any chance running this in the browser?

AdityaManohar avatar Sep 04 '14 17:09 AdityaManohar

var AWS = require('aws-sdk'); try{ var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); }catch(error){ console.log('error:',error.stack) }

TypeError: undefined is not a function at Object. (/home/ec2-user/ericyang/dev/rest/test.js:3:11) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.runMain (module.js:487:10) at process.startup.processNextTick.process._tickCallback (node.js:244:9)

EricYang avatar Sep 05 '14 10:09 EricYang

I tried to print property of AWS below and I can't found any function about 'CloudSearchDomain'. AWS's property: util,VERSION,ServiceInterface,Signers,XML,Service,Credentials,CredentialProviderChain,TemporaryCredentials,WebIdentityCredentials,SAMLCredentials,Config,config,Endpoint,HttpRequest,HttpResponse,HttpClient,SequentialExecutor,JSON,QueryParamSerializer,EventListeners,Request,Response,ResourceWaiter,ParamValidator,events,NodeHttpClient,SES,IAM,SimpleDB,CloudTrail,ElastiCache,Route53,Support,CloudWatch,ELB,OpsWorks,SWF,EC2,DataPipeline,SQS,RDS,DynamoDB,Glacier,CloudSearch,StorageGateway,AutoScaling,Redshift,STS,CloudFront,SNS,EMR,CloudFormation,ElasticBeanstalk,S3,DirectConnect,ImportExport,ElasticTranscoder,Kinesis,MetadataService,EC2MetadataCredentials,EnvironmentCredentials,FileSystemCredentials

EricYang avatar Sep 05 '14 10:09 EricYang

Thanks for the stack trace! Which version of the SDK are you using?

AdityaManohar avatar Sep 05 '14 17:09 AdityaManohar

"name": "aws-sdk", "description": "AWS SDK for JavaScript", "version": "2.0.15"

EricYang avatar Sep 05 '14 17:09 EricYang

@EricYang can you print the AWS.VERSION in your script? Also, what version of Node.js are you using, and what OS are you running this on?

lsegal avatar Sep 05 '14 18:09 lsegal

Info as below AWS.VERSION: 2.0.0-rc.14 node: v0.8.1 os:Linux xxxxxx.amzn1.x86_64 #1 SMP Wed Apr 2 09:36:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

EricYang avatar Sep 06 '14 02:09 EricYang

Support for CloudSearchDomain was added in a later release than the one you are using. I would recommend updating your SDK to the latest (2.0.15) via npm install [email protected].

I am going to close this issue since this seems to be the cause. Feel free to reopen if you are still having trouble after updating the SDK.

lsegal avatar Sep 06 '14 02:09 lsegal

its weird, I tried to update sdk sudo npm install [email protected] but I found the AWS.VERSION is still 2.0.0-rc.14

EricYang avatar Sep 06 '14 02:09 EricYang

Oh I'm sorry that I update the sdk from wrong path!! orz....sorry Thank you very much.

EricYang avatar Sep 06 '14 02:09 EricYang

As a sidenote, you should not be using sudo to install npm packages, as they always reside inside your application path, and never in a system directory.

lsegal avatar Sep 06 '14 02:09 lsegal

got it! thanks.^^

EricYang avatar Sep 06 '14 02:09 EricYang

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

lock[bot] avatar Sep 30 '19 02:09 lock[bot]