[Pkg-javascript-devel] Bug#922824: Bug#922824: sourceMappingURL in minified js seems to point to the wrong location

Paolo Greppi paolo.greppi at libpf.com
Thu Feb 21 10:02:48 GMT 2019


Hi Enrico,

On 21/02/19 09:31, Enrico Zini wrote:
> ...
> If I make one of those paths accessible on the web and include bootstrap
> with something like:
> 
>    <script src="{{static_url('bootstrap4/js/bootstrap.min.js')}}"></script>
> 
> Then I see the browser make this failed request on my HTTP server:
> 
>    404 GET /static/bootstrap4/js/dist/js/bootstrap.js.map
> ...

it works for me in this way:

1. install nginx web server and libjs-bootstrap4:

   sudo apt install libjs-bootstrap4 nginx

2. install the nginx snippet provided in https://bugs.debian.org/818585

   sudo wget -O /etc/nginx/snippets/javascript-common.conf "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=818585;filename=javascript-common.conf;msg=5"

3. include the snippet in /etc/nginx/sites-enabled/default:

   include snippets/javascript-common.conf;

4. restart nginx

   sudo systemctl restart nginx

5. place this content in a /var/www/html/test.html file:

   <html>
    <head>
     <title>libjs-bootstrap4 test</title>
    </head>
    <body>
     <script src="/javascript/bootstrap4/js/bootstrap.min.js"></script>
     <script src="/javascript/popper.js/popper.js"></script>
    </body>
   </html>

6: visit http://localhost/test.html

sourceMappingURL is related to source maps, i.e. a way to make the readable JS source available while you debug minified code in the browser
it is possible that the libjs-bootstrap4 source maps are broken, but that comment should not impact routing the request to the minified file on disk

Paolo



More information about the Pkg-javascript-devel mailing list