How are you setting these scripts up? Are you importing them into resources and then compiling them using something like laravel mix? Or are you puttin them directly into the public folder and then trying to reference them that way?
Failed to load resource (404) > Partly solved
Hey all,
Here again with another question, I'm experiencing errors in the inspector element stating for several assets :
failed to load resource: the server responded with a status of 404 (Not Found)
This is the case for 5 assets
- http://test.test/public/fonts
- http://test.test/js/vendor.min.js
- http://test.test/css/icons.min.css.map
- http://test.test/css/app-dark.min.css.map
- http://test.test/css/app.min.css.map
These are my paths, which should be correct...
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('public/fonts') }}">
<!-- JS -->
<script src="{{ asset('js/vendor.min.js') }}"></script>
<script src="{{ asset('js/app.min.js') }}"></script>
<script src="{{ asset('js/main.js') }}"></script>
<script src="{{ asset('js/bootstrap.js') }}"></script>
<script src="{{ asset('js/app.js') }}"></script>
<script src="{{ asset('js/app.min.js.map') }}"></script>
I'm not sure as to why only 1 js script is thrown up as an error..
<!-- App css -->
<link rel="stylesheet" href="{{ asset('css/icons.min.css') }}" type="text/css">
<link rel="stylesheet" href="{{ asset('css/app.min.css') }}" type="text/css" id="light-style">
<link rel="stylesheet" href="{{ asset('css/app-dark.min.css') }}" type="text/css" id="dark-style">
<link rel="stylesheet" href="{{ asset('css/style.css') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
Same here, but seems that it's only my imported bootstrap stylesheets that are off.
The fonts assets have the following path : public/fonts/allfontsplacedhere The css assets have the following path : public/css/allcssstylesheetsplacedhere The js assets have the following path : public/js/alljsstylesheetsplaceshere
Beside these errors i also got 4 other .js errors but expect that this is related to the above.
Are my paths really incorrect?
I've posted a few pics on imgur if you think it's necessary to see my map structure https://imgur.com/a/BpxE9EI
- Start with your HTML, what does it want to load?
-
{{ asset('js/vendor.min.js') }}translates to loadinghttp://domain.com/js/vendor.min.js, so you must make sure it exists inpublic/js/vendor.min.js - Repeat #2 for your fonts, CSS and JS.
Please or to participate in this conversation.