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

vinsonyung's avatar

Cannot update Elixir asset path

Hi guys,

I need some directions for Elixir versioning.

I am trying to gulp all my assets in localhost server instead of production server. Then commit all files in public/build/ to git server. After that, I will deploy them to production servers directly. However, I got 404 File not found error after running gulp --production when I tried to update the version of assets.

Before re-versioning my assets, I have this line in app.blade.php file

<link href="{{ elixir('css/essential.css') }}" rel="stylesheet" type="text/css" />

I got this in page source

<link href="/build/css/essential-901757eda6.css" rel="stylesheet" type="text/css" />

I have this line in gulpfile.js

mix.version(['css/essential.css']);

Everything works fine.

However, after running gulp --production, I got essential-a9d263a62e.css in public/build/css folder.

And this in public/build/rev.manifest.json

{
  "css/essential.css": "css/essential-a9d263a62e.css",
}

Then I run this to clear all compiled views

php artisan view:clear

I expected the css path should update to

<link href="/build/css/essential-a9d263a62e.css" rel="stylesheet" type="text/css" />

But, it still shows the old path in page source.

Am I wrong in any steps?

0 likes
2 replies
ejdelmonico's avatar

Try deleting the essential-a9d263a62e.css and revision manifest from the public/css and run gulp --production again. Also, I find it helpful to run gulp first and then gulp --production.

vinsonyung's avatar
vinsonyung
OP
Best Answer
Level 7

Thanks @ejdelmonico. I finally figured out it is my Nginx setting problem.

location ~* \.(?:ico|gif|css|js|jpe?g|png|woff|ttf|otf|svg|woff2|eot)$ {
        expires 30d;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

I remove css from the cache list. So css changes take effect immediately.

Please or to participate in this conversation.