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

undefined is not an object (evaluating 'endpointFunctions[fn].apply')] #5889

Closed
3 tasks done
JeyShah opened this issue Mar 13, 2024 · 5 comments
Closed
3 tasks done
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@JeyShah
Copy link

JeyShah commented Mar 13, 2024

Checkboxes for prior research

Describe the bug

We are using @aws-sdk/client-location to get SearchPlaceIndexForPositionCommand of lattitude and longitude and also using @aws/amazon-location-utilities-auth-helper to get credentials from aws through withAPIKey function, but while sending command it returns Error occurred: [TypeError: undefined is not an object (evaluating 'endpointFunctions[fn].apply')].

We are using react native.
code sample as below

import { LocationClient, SearchPlaceIndexForPositionCommand } from '@aws-sdk/client-location';
import { withAPIKey } from "@aws/amazon-location-utilities-auth-helper";

const authHelper = await withAPIKey(<API_KEY>);
const client = new LocationClient({
region: "ap-southeast-1",
...authHelper.getLocationClientConfig() // sets up the Location client to use the API Key defined above
});

const command = new SearchPlaceIndexForPositionCommand({
IndexName: "<INDEX_NAME>", // Place index resource to use
Position: [-123.1187, 49.2819], // position to search near
MaxResults: 10 // number of results to return
})

try {
const result = await client.send(command);
}
catch (error) {
}

SDK version number

"@aws-sdk/client-location": "^3.529.1", "@aws/amazon-location-utilities-auth-helper": "^1.0.4",

Which JavaScript Runtime is this issue in?

React Native

Details of the browser/Node.js/ReactNative version

0.64.1

Reproduction Steps

Just run the code and it throws error

Observed Behavior

Error occurred: [TypeError: undefined is not an object (evaluating 'endpointFunctions[fn].apply')]

Expected Behavior

{
Categories: [ 'PointOfInterestType' ],
Country: 'MYS',
Geometry: { Point: [ 101.71371, 3.15908 ] },
Interpolated: false,
Label: 'SEPHORA, Jalan Ampang, KLCC, Bandar Kuala Lumpur, Kuala Lumpur, 50450, Wilayah Persekutuan Kuala Lumpur, MYS',
Municipality: 'Bandar Kuala Lumpur',
PostalCode: '50450',
Region: 'Wilayah Persekutuan Kuala Lumpur',
SubMunicipality: 'KLCC',
SubRegion: 'Kuala Lumpur',
SupplementalCategories: [ 'Specialty Store' ]
}

Possible Solution

No response

Additional Information/Context

No response

@JeyShah JeyShah added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 13, 2024
@kuhe
Copy link
Contributor

kuhe commented Mar 13, 2024

Try adding a line at the start of your application to import "@aws-sdk/util-endpoints"

import "@aws-sdk/util-endpoints";
// or
require("@aws-sdk/util-endpoints");

@JeyShah
Copy link
Author

JeyShah commented Mar 13, 2024

Try adding a line at the start of your application to import "@aws-sdk/util-endpoints"

import "@aws-sdk/util-endpoints";
// or
require("@aws-sdk/util-endpoints");

After this Error changed to [Error: not implemented] on client.send line

@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Mar 15, 2024
@kuhe
Copy link
Contributor

kuhe commented Mar 21, 2024

What is the actual stack trace?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Mar 22, 2024
@kuhe kuhe added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Mar 29, 2024
Copy link

github-actions bot commented Apr 1, 2024

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Apr 1, 2024
@github-actions github-actions bot closed this as completed Apr 6, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants