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

How to include react-map-gl in Gatsby #19263

Closed
arhoy opened this issue Nov 5, 2019 · 8 comments
Closed

How to include react-map-gl in Gatsby #19263

arhoy opened this issue Nov 5, 2019 · 8 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@arhoy
Copy link

arhoy commented Nov 5, 2019

I am looking to see how I can include this library in a gatsby app.
I have it working in development but the mapbox is not loading in production, with the issue being No Token Warning.

If anyone has any experience including a mapbox map inside Gatsby I can help me out, it would be greatly appreciated.

I have added the environment variable to Netlify like usual.

My repo where I am using MapBox is : https://github.com/arhoy/fashion-two

I was not able to find any mapbox related plugin in Gatsby currently

@gatsbot gatsbot bot added the type: question or discussion Issue discussing or asking a question about Gatsby label Nov 5, 2019
@muescha
Copy link
Contributor

muescha commented Nov 5, 2019

This starter is also using map-gl:

#19250

@arhoy
Copy link
Author

arhoy commented Nov 5, 2019 via email

@muescha
Copy link
Contributor

muescha commented Nov 5, 2019

ok :(

@LekoArts
Copy link
Contributor

LekoArts commented Nov 6, 2019

Thank you for opening this!

Please have a look at issues like #6667 or this starter: https://github.com/brendan-ward/gatsby-starter-mapbox
You can also consult our documentation about debugging the build: https://www.gatsbyjs.org/docs/debugging-html-builds/#fixing-third-party-modules

We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!

@LekoArts LekoArts closed this as completed Nov 6, 2019
@muescha
Copy link
Contributor

muescha commented Nov 6, 2019

and if you find a solution how you fixed your issue it would be nice to see your solution

@arhoy
Copy link
Author

arhoy commented Nov 8, 2019

I figured out the issue, The only thing I changed was how i named the env variable inside Netlify.
Must be prefixed with GATSBY which is kinda strange. I don't always do this for all environment variables but maybe I will start to.
ie GATSBY_MAPBOX_API_TOKEN=

@muescha
Copy link
Contributor

muescha commented Nov 8, 2019

Thx. In your code or in netlify settings.

is it described here: https://www.gatsbyjs.org/docs/environment-variables/ ?

Or here: https://www.gatsbyjs.org/docs/deploying-to-netlify/ ?

Or is there something missing so An PR can improve the docs?

@arhoy
Copy link
Author

arhoy commented Nov 13, 2019

Interesting, Thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants