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

Better error messaging when region is omitted #57

Closed
mojodna opened this issue Oct 9, 2021 · 2 comments
Closed

Better error messaging when region is omitted #57

mojodna opened this issue Oct 9, 2021 · 2 comments
Assignees

Comments

@mojodna
Copy link
Contributor

mojodna commented Oct 9, 2021

When region is missing from either the createMap factory or from the Amplify configuration (geo.AmazonLocationService.region), URLs like the following are generated:

https://maps.geo.undefined.amazonaws.com/maps/v0/maps/map30307599-dev/style-descriptor

The requests predictably fail, but the console doesn't really provide an indication why (esp. if one doesn't notice the undefined). An improved developer experience would involve noting this and logging a more helpful message (along the lines of "Please provide provide a region "), potentially by throwing an exception.

@thaddmt thaddmt self-assigned this Oct 11, 2021
@DominicBortmes
Copy link

Summary

I am also experiencing the same issue and found that adding the region explicitly as a param of the createMap function call helps to work around. The current readme of master gives a working example.

Details

I can reproduce with @aws-amplify/[email protected] and @aws-amplify/[email protected] (didn't test older versions though).
An interesting observation is that the browser's console prints out a CORS error and one must pay attention to the logged out CORS Request URL. It follows the pattern https://maps.geo.**undefined**.amazonaws.com/maps as pointed out by @mojodna.

Next steps

I expect @thaddmt will facilitate the next steps. Gladly this issue can be worked-around in the meantime.
(Full disclosure: I am an affected user of the issue and not part of the maintaining team)

@thaddmt
Copy link
Member

thaddmt commented Oct 25, 2021

Just released v1.1.1 which should have this fix included! - https://www.npmjs.com/package/maplibre-gl-js-amplify/v/1.1.1

@thaddmt thaddmt closed this as completed Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants