Modal Dialog not Opening when not authenticated or in incognito mode Hi i am using Drupal 8 to render a modal popup on clicking a link. However when i am connected as admin the popup render well but as soon as i logout or choose to be incognito mode of the browser the popup does not appear and the page is redirected to link set in the href tag. Here is my link :

&lt;a href="/mysite.com/contact/download_file_advance?nid=371" class="use-ajax" data-dialog-type="modal" data-accepts="application/vnd.drupal-modal" data-filename="Livre Blanc"&gt;SOME TEXT IN MODAL&lt;/a&gt;


Can anyone explain to me why this is so? I can't figure out why when i am connected the modal render well but when not connected it redirect me to the node.
Ajay is correct, the javascript dependencies wont load by default for anonymous users. Here's what I added to my theme.libraries.yml to get it working:

dependencies: 
  - core/jquery
  - core/drupal.dialog.ajax