Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

JS assets don't get included if global cache is on

Started by Julien 6 years ago · 3 replies · 544 views
6 years ago

I'm seeing confusing behavior that I'm trying to figure out. Here is the rough scenario:

  • I have a modular page template that adds a JS asset:
    {% do assets.addJs('theme://js/bar.js') %}
  • Initially, everything worked fine, the page with the modular page did load the JS
  • Suddenly, the Javascript file is not being included in the page anymore
  • Toggling the js_pipeline option from true to false (or vice versa) will temporarily fix this, but shortly after the file will not be included again

What could possibly be the cause for this behavior?
Grav is at the most recent version, 1.6.23.

Update: It seems like turning off the global Cache option prevents this issue from happening. This explains why I never ran into the problem during development and only now that I've deployed the page. I will use this is a workaround for now, but it obviously isn't a fix/answer.

last edited 04/09/20 by Julien
6 years ago

Thanks hughbris. I decided to unmark your reply as 'solution' for now, as I'm not yet sure whether what I'm seeing is an actual Grav bug or simply a config/template issue on my part. It seems like other people should've already run into this issue before if it was a bug. Hence, I'd like to potentially get some more input on that before reporting a bug.

If there is no input coming in over the next days, we can mark your reply as solution again. I hope you're okay with that?

last edited 04/10/20 by Julien
6 years ago

No problem. Now that you've added more replies, probably use one of yours as solution instead when you're ready :)

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 95 14 hours ago
General · by pamtbaau, 20 hours ago
1 61 19 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 356 5 days ago
General · by Duc , 6 days ago
3 44 6 days ago