I assume this happens on line 3, possibly because on line 1 var map = document.querySelector('#map') could not assign map correctly.
Please first make sure that the element id="map" exists.
Maybe try another syntax like var map = document.getElementById('map') although what you've written should be correct as well.
If you can't make progress try debugging it so far, that you can say which line exactly causes the error and maybe you can check the execution step by step.
This confirms my suspicion. As the error reads: map is null at that time. So obviously line 1 which reads var map = document.querySelector('#map') is not correct. Please make sure to correctly query the map element.
@michapietsch I've changed the first line with getElementById('map').
But what do I have to change on the second line? Does it depends on my structure in blade.php..? Srry I'm kinda nub at this..
the problem comes in the first line, just change
var mapp = document.querySelector('#map') to
var mapp = document.querySelector('.map'), you have to create a class map in your div which content whatever in.
The node with the id #map is not present in the DOM at the time the JS code is executed. If the HTML code is in the same file as the JS code then the JS code section should be moved to the bottom of the file. Otherwise, make sure to load the JS code after the node is created in the DOM.