-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Missing Mapbox GL JS CSS #5785
Comments
It's not an error, it's just a placeholder that becomes visible only when CSS is actually missing. Are you experiencing any problems with the map itself? |
@mourner Thanks for the reply! Following is the example I'm trying to make work:
and the HTML:
I'm
And this is the end result I'm getting: |
So the CSS file is not missing, the placeholder message is not visible, and the map is not showing :) |
Can you set up a minimal JSFiddle test case with all the already generated code? We can't afford debugging all possible configurations of front-end bundling, but with an isolated test case, it would be easy to see where the problem is. |
Hmm, I'm not sure if I thought maybe it is a known issue, since the example I used is super easy and the browserify usage is very common. Thanks for the answer. Unfortunately I cannot afford writing a test-case right now as well :\ Good luck. |
I have the same problem, the CSS is loaded. I think it has something to do with me using React or Webpack. |
For me the issue was that I had the css being loaded at the bottom of the DOM, not in the Head section. It was thus flashing up on my map while it loaded the DOM. |
I experienced this issue when upgrading from 0.40.1 to 0.43.0. Nothing else changed in my code. When downgrading back to 0.40.1, the missing CSS message went away. |
I fixed this issue by adding this line |
No need for a JSFiddle as it's happening on the official example pages: https://www.mapbox.com/mapbox-gl-js/example/simple-map/ |
@abevoelker The presence of that div in the source shown in the developer console is expected behavior and does not indicate a problem. The Mapbox GL CSS file contains a directive that hides that div. If you are seeing it in the rendered result, it means that you forgot to include the CSS file. |
My bad, sorry for the noise 🙇♂️
…On Mon, Feb 12, 2018 at 6:06 PM John Firebaugh ***@***.***> wrote:
@abevoelker <https://github.com/abevoelker> The presence of that div in
the source shown in the developer console is expected behavior and does not
indicate a problem. The Mapbox GL CSS file contains a directive that hides
that div. If you are seeing it in the rendered result, it means that you
forgot to include the CSS file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5785 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJXc3LNiKgjHmXxCrjFJ2Lk4aBvQ-wuks5tUNH5gaJpZM4Qyas->
.
|
For Angular 5, import the type into your style.css,
Takes care of the problem completely. @mistercrunch - Thank you, for your solution, my own is just a modification of yours for Angular 5 .. |
create-reat-app: import 'mapbox-gl/src/css/mapbox-gl.css'; |
Fixes #191. When loading the address page, the following annoying warning is always logged: > This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/. The actual page doesn't seem to have any visual problems, though... Still, the warning is annoying and according to mapbox/mapbox-gl-js#5785 we need to import the CSS in our code, which this commit does, and the warning goes away. I just hope it's not adding unnecessary bloat to our page weight.
I am trying to make this work with choojs and Browserify.
The error I'm getting:
Missing Mapbox GL JS CSS
Actually I need to open Chrome devtools to see the error message, it is written in a tag withdisplay: none
:<div class="mapboxgl-missing-css">Missing Mapbox GL JS CSS</div>
I have included a link to the CSS file in HTML, but still all I'm seeing is this error message.
What is
Mapbox GL JS CSS
? Is that a file name?How do you determine that the CSS file is missing by the way? and why is that so important?
The text was updated successfully, but these errors were encountered: