0

my browser console is showing me an error, that the .css is missing. Indeed the map is only like "half loaded" . It worked before, but now I have implemented a directory structure like so:

in my src:

App.jsx
directory_1
   directory_2
      map_file.jsx

I'm using import "mapbox-gl/dist/mapbox-gl.css" in my map_file.jsx . Do I need to specify the path to the .css?

KurgerBing
  • 173
  • 1
  • 2
  • 16
  • check your webpack configuration, perhaps you're missing something. Check css-loader and style loader, or what loader that you're using? – mfakhrusy Feb 20 '19 at 13:34
  • I really don't have any clue, where my webpack config could be. as well my style loader or css loader. I'm using react, that's it :-) – KurgerBing Feb 20 '19 at 13:44
  • oh so you're using create-react-app, alright. found this: https://stackoverflow.com/questions/50909438/missing-mapbox-css-using-react can this solution works for you? – mfakhrusy Feb 20 '19 at 13:46
  • I found this solution, too, didn't work. when I zoom in my web app, the map is switching to the correct mode. I guess it's something with loading of the css. The console is giving me a `href="blob:http://localhost:3000/53a8fe2b-0464-4ab8-aa7d-5f322ffe59e7"` as link type of the css – KurgerBing Feb 20 '19 at 14:40
  • It's hard to tackle the problem since the abstraction of create-react-app makes it harder to configure by our own. – mfakhrusy Feb 20 '19 at 16:51
  • My suggestion is to configure your react app by yourself by using webpack + babel, there are many tutorials around internet to get started, good luck. – mfakhrusy Feb 20 '19 at 16:51
  • however I found this package: https://www.npmjs.com/package/react-mapbox-gl have you used that? – mfakhrusy Feb 20 '19 at 16:52

0 Answers0