Laravel Asset did not get rendered
salwaahmadz
HOBBYOP

a year ago

Hello everyone,

I'm new to railway and any other deployment apps activity. I'm here having a problem after I successfully deploy my Laravel 10 apps. But the problem is, the asset it have did not get rendered such as css and javascript. I look up to browser elements and I believe the url was correct but somehow the styling did not get applied to the apps. Also, the assets is rendered just fine in the localhost. How can I solve this problem?

Thank you.

Project ID: da37acbb-4f8f-4d95-bd64-c5edcbff5ce2

16 Replies

a year ago

hello!

In your service settings, can you try switching to the Railpack builder?

edit, i swapped for you, but not it says there is no version found for php 8.1, we will look into it


salwaahmadz
HOBBYOP

a year ago

Hello Brody!

I just checked my railway dashboard and there's a failed deployment. Based on what you said, is it because I used PHP version 8.1? Should I use newer PHP version?


a year ago

yes, you can try that.


a year ago

it shouldn't break on 8.1, though.


a year ago

frakenphp only supports 8.2+ so technically it shouldn't build, railpack will likely have to fall back to caddy + php-fpm for 8.1 and under


salwaahmadz
HOBBYOP

a year ago

So I have to change every asset() to secure_asset() then? Okay, I'll try


salwaahmadz
HOBBYOP

a year ago

I'll upgrade my php to php 8.3 (which currently I used)


salwaahmadz
HOBBYOP

a year ago

Hello Brody

I just updated my php to 8.3 version. How do I run composer update in railway? is there a cli in Dashboard? Also I have a problem with extension zip. In local, I can simply remove semicolon ";" on ";extension=zip" in the php.ini, but how do I do that in railway?


a year ago

You run it locally to update the lockfile, and then push your changes. To use the zip extension, add "ext-zip": "*" to your composer.json requires.


alex-bytes
PRO

a year ago

I had the same issue and can confirm it's due to assets not being loaded over https. So you need to make sure all assets are served over https


alex-bytes
PRO

a year ago

Glad to see my solution is not considered a hackjob! I was too uncertain to post it 😂


salwaahmadz
HOBBYOP

a year ago

I already add the force HTTPS scheme to AppServiceProvider but it seems my problem is around updating packages. I also already push the new composer requirement but still got this deploy logs.

1349780993653080134


salwaahmadz
HOBBYOP

a year ago

1349781234422648852


salwaahmadz
HOBBYOP

a year ago

Oh yeah I just checked it and there's phpoffice on the composer.lock. I thought running on autoload-dump can refresh di autolock too.


salwaahmadz
HOBBYOP

a year ago

Hello Everyone

Update:

The assets of my apps is now rendered after I changed back from railpack to nixpack. But another problem is occured which I can't access the pages I have in the apps.

1349798623776346254

1349798624111886427


salwaahmadz
HOBBYOP

a year ago

I also try to use app debug and the problem is blade template is not found. What cause it to happen when it works fine in the localhost?

1349799836999745718


Welcome!

Sign in to your Railway account to join the conversation.

Loading...