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

sebfrey's avatar

CSS & JS not linked correctly

Hey, I am new to Laravel, Nova, etc. In the login panel for Nova, the HTML shows this:

link rel="stylesheet" href="/vendor/nova/app.css?id=83e9424dd6715db59894"

But /vendor/nova/app.css is not the right path, so it does not find the .css and returns a 404. Same is true for the JavaScript files the panel wants to load:

script src="/vendor/nova/manifest.js?id=2d315777967b6001bcf1"

That's not the path either. How do I tell Laravel / Nova where to look for these dependencies?

0 likes
8 replies
munazzil's avatar

Can you post your blade template within this tag things i means your links and href.

   <head>

  </head>
sebfrey's avatar

Sure. This is a totally stock Nova install, so it's not "my" blade template, it's Nova's blade template. I am grabbing this from nova's layout.blade.php

<title>{{ Nova::name() }}</title>

<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,800,800i,900,900i" rel="stylesheet">

<!-- Styles -->
<link rel="stylesheet" href="{{ mix('app.css', 'vendor/nova') }}">

<!-- Tool Styles -->
@foreach(Nova::availableStyles(request()) as $name => $path)
    <link rel="stylesheet" href="/nova-api/styles/{{ $name }}">
@endforeach

sebfrey's avatar

Hey so I modified mix-manifest.json to specify the correct path to my app.css etc files:

{ "/app.js": "/app/nova/public/app.js?id=xxx", "/app.css": "/app/nova/public/app.css?id=xxx", "/vendor.js": "/app/nova/public/vendor.js?id=xxx", "/manifest.js": "/app/nova/public/manifest.js?id=xxx" }

and now the CSS link appears as:

link rel="stylesheet" href="/vendor/nova/app/nova/public/app.css?id=83e9424dd6715db59894"

Hmmm...I think I am on the right path but not quite there. Suggestions?

munazzil's avatar

You have to add as like below in your blade,

   <link href="{{ asset('css/app.css') }}" rel="stylesheet">
   <link href="{{ mix('css/app.css') }}" rel="stylesheet" type="text/css">

and for the nova something like below,

 <link rel="stylesheet" href="{{ mix('public/app.css') }}">
Cronix's avatar

what dirs are actually present within the /public dir? Is there a vendor dir in there?

Have you run npm run dev? You shouldn't have to manually be editing the manifest.json file.

sebfrey's avatar

@MUNAZZIL - Hi, thank you - but again, this is not "my" blade. This is the blade that comes with Nova. I don't think it's supposed to be edited like that. Should it not just work?

sebfrey's avatar

@CRONIX - All the files that should be in /public are there: app.css, app.js, manifest.js, mix-manifest.json, and vendor.js. Yes, I have run npm run dev

forashraf's avatar

Dear, I also stuck in the same issue. Kindly share, if you have got any solution, please.

Please or to participate in this conversation.