Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nutkani1337's avatar

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:5173/resources/view/vendor/jquery/jquery.min.js. (Reason: CORS request did not succeed). Status code: (null).

Hey folks getting below error in console while adding additional scripts in my "app.blade.php" file using vite.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:5173/resources/view/vendor/jquery/jquery.min.js. (Reason: CORS request did not succeed). Status code: (null).

I'm using Inertia.js with vue and laravel and i have downloaded a bootstrap template which i'm trying to convert into full application. Thing is the template is working fine but "Mobile Toggler" button was not working when i switched to "Mobile Screen". I thought this is because of some jquery and javascript files (that were included in that bootstrap template before the body of HTML Close).

This is how I'm trying to include it:

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
  <!-- External Style sheet -->

  @vite('resources/css/app.css')
  @inertiaHead
</head>

<body>
  @inertia
  @vite('resources/js/app.js')

//Please note  Path of the scripts is correct 
  @vite('resources/view/vendor/jquery/jquery.min.js')
  @vite('resources/view/vendor/bootstrap/js/bootstrap.bundle.min.js')
  @vite('resources/view/vendor/jquery/jquery.min.js')
  @vite('resources/view/vendor/magnific-popup/magnific-popup.js')
  @vite('resources/js/vendor/js/plugins/magnific-popup-init.js')
  @vite('resources/js/vendor/js/js/scripts.js')

  </body>

</html>

If you need to look at package.json file i can provide it in comment section. Any lead or suggestion would be highly appreciated. Thanks in Advance :)

0 likes
0 replies

Please or to participate in this conversation.