@asset outputting in plain text

In content.blade.php the I call @asset('image/placeholder.jpg') and its only outputing in plain text.

I’ve called the placeholder image in the past from a Controller (as a backup when grabbing a thumbnail), but never in the template file itself until today.

This is a clone of another theme i was working on, so i did a lazy copy+paste when in dropped it in the theme folder. Any idea on how i can debug this? I’ve already:

  • Check error logs
  • Removed Node_modules and rebuild them with yarn

I have a feeling its a composer issue, but not sure how to go about tracking down the issue.

Unless you have added your own resources/assets/image directory, you should request ‘images/placeholder.jpg’.

Thanks for catching that, I just checked and that was just a typo on my part here. it was correct in my theme. So its not that sadly :confused:

The @asset directive is provided here: https://github.com/roots/sage/blob/f3e794a09374d2f110742d15b9b975490fcddbee/app/setup.php#L127

I’d check first to make sure that code exists in your theme (directives not being parsed usually means blade didn’t recognize a custom directive), and if it does then use that as a starting point for debugging.

Thanks so much for taking the time to reply!

I went and looked and it is in there still, so I’ll have to take a look and debug from there. Thanks for the suggestion though, i couldn’t figure out where it was originating.

Since you’ve copied from another project, have you run yarn run build yet?
I’ve had the exact same issue at one point and that’s because I hadn’t built after adding my new image.

This topic was automatically closed after 42 days. New replies are no longer allowed.