My website isn't loading the css files
michael679089
FREEOP

6 months ago

$10 Bounty

10 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


michael679089
FREEOP

6 months ago

I have to manually add the css from my npm run build in my computer to the website.

The CSS is not loaded with the website, it's not there, why is that?


What's your tech stack?


Status changed to Awaiting User Response Railway 6 months ago


mahmoud-railway

What's your tech stack?

michael679089
FREEOP

6 months ago

what is a tech stack?


Status changed to Awaiting Railway Response Railway 6 months ago


michael679089
FREEOP

6 months ago

If you're asking what Framework I'm using, I used Laravel to make this website.


fra
HOBBYTop 10% Contributor

6 months ago

are you using the right url for the css & images? you should check in the console and see the url you are using to load the file and fix it accordingly


fra

are you using the right url for the css & images? you should check in the console and see the url you are using to load the file and fix it accordingly

michael679089
FREEOP

6 months ago

I'm using @vite to access my css and javascripts. I did npm run build in my dockerfile but when running that dockerfile in the railway project, the css didn't load even though in the directory the public folder contains the javascript and the css.


michael679089
FREEOP

6 months ago

This is what my master-layout.blade.php looks like:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<meta http-equiv="X-UA-Compatible" content="ie=edge" />

<title>Think Finance</title>

<!-- Fonts -->

<link rel="preconnect" href="https://fonts.bunny.net" />

<link

href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600"

rel="stylesheet"

/>

<!-- Styles / Scripts -->

@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))

@vite(['resources/css/app.css', 'resources/js/app.js'])

@else

@endif

</head>

<body class="bg-yellow-10">

{{-- Adjust background color to match design --}}

@include('components.header')

<main class="container mx-auto px-4 pb-10">

@include('layouts.flash-messages')

@yield('content')

</main>

@include('components.footer')

</body>

</html>

-----

This is what my app.css looks like:

@import "tailwindcss";

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';

@source '../../storage/framework/views/*.php';

@source '../**/*.blade.php';

@source '../**/*.js';

@theme {

--font-sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif,

"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",

"Noto Color Emoji";

}

.chip-design {

@apply flex items-center gap-1 bg-blue-100 text-blue-700 px-3 py-1 rounded-full text-sm;

}


michael679089
FREEOP

6 months ago

My local docker I created for my website is working, my docker file is working, can I just send the docker image to the railway deployment to turn it into a website?


fra
HOBBYTop 10% Contributor

6 months ago

can you open the console in the browser and check the network tab? you should see a few 404, if we know the current requested url we can find the issue and fix it


Loading...