Put scripts placeholder not working as expected

I had already setup the scripts placeholder, and it was working correctly.

My layout.htm had

{% scripts %}

and my home page in editor had the following

{% put scripts %} ... javascript stuff... {% endput %}
`

However, recently I installed a new plugin, and after running composer install, a list of plugins updated (which I do not have a snapshot of.) the placeholder is not working as expected.

What could have affected this, what is a potential area where I could start my investigate from to diagnose this problem?

Hi @tasaduqbahl,

If I were in your situation, I would start by comparing the current state with the previous one to identify any changes. If you don’t have a backup to reference, try checking the browser console for any errors or issues with loading file assets. That might give you some clues.

ok, so I apologize for my previous reply, I made that in a bit haste and made a mistake.

So, I tried to see if hasPlaceholder(‘scripts’) works and whether the placeholder exists or not.

And the placeholder exists as, as this statement returns true.

Which has lead me to believe its {% scripts %} not rendering the content within the put scripts.

its possible that an error inside the {% put scripts %} is provocating the issue

I have tested by using the following simple script, but facing the same problem

{% put scripts %}
<script>
console.log('loading');
</script>
{% endput %}

Can anyone please help, I have tried but nothing has helped thus far. and I had utilized put scripts a lot, and if this doesn’t get sorted, I will have to restructure the whole thing :confused:

Hi @tasaduqbahl

We have browser tests that check that this feature is working all the time, so it must be something to do with your configuration. Interesting that it stopped working after an upgrade.

Try making a fresh installation and see if you can reproduce the problem in isolation. If you find that it is working there, continue to introduce variables (structure, plugins, etc.) from the site that isn’t working. Following this process you should find which element causes the issue.

If it occurs during a fresh installation, it could be a bug, provide us with the replication steps and we can take a look.