Updated to new version, pages broken

4 replies · opened Jun 7, 2023

CcadilhacJun 7, 2023

Hi,

I updated to the latest version (not sure if I had the version before or an older one) and now pages are completely blank. There is no error message in the console except this, which is maybe to related at all:

Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.

Remember when I needed to setup JS with an absolute path (https://support.semicolonweb.com/forums/topic/setup-question/)? This may be related.

If I check the wrapper element, its opacity is 0. If I manually set it to 1 in the browser, then the page appears. But the menu looks like it is on a mobile (although I'm desktop screen with full width) and clicking it does nothing. So it's as if JS was not loading and not running correctly.
Did something change about JS loading that I should be aware?

Right now, I use this to load JS:

Can you help?
Thanks

SSemicolon WebSTAFFJun 7, 2023

Hello,

Yes, JS Loading was updated in the Latest Update and now uses:

<script src="js/plugins.min.js"></script>
<script src="js/functions.bundle.js"></script>

instead of the above codes. This resolves many other issues with JS Loading and reduces execution delays.

Applying these codes will resolve your issues. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

CcadilhacJun 7, 2023

Thank you. In your new code I added a forward slash to indicate an absolute path.
Seems to work.

But why isn't it in your documentation?

I can only find a mention of loading JS from another folder which strangely uses paths prefixed by the domain and a dangerous "modify the functions.js file to set jsFolder and cssFolder"... Won't use this but modifying your functions.js is a strange solution. Would have to do it each time I switch to a new version? Error prone.

CcadilhacJun 7, 2023

Sorry I see it in your doc now. Maybe a cache issue here.

But I'm a bit puzzled now. Since I load JS from an absolute path, as a rookie I would tend to use your "Using Custom JS/CSS Folders" method. But again, why use loading functions.js prefixed by a domain and why make the developer modify functions.js to set jsFolder and cssFolder variables?

SSemicolon WebSTAFFJun 8, 2023

Hello,

  1. We will definitely introduce a JS Variable that you can add to your HTML Codes instead of editing the js/functions.js File in the next update for sure.

  2. The best way to prefix the JS/CSS Folders is to add the Domain. This is why CDN were introduced and also this is the way it is used in major CMS. Consider this, if someone wishes to use Canvas inside a Sub-Folder: https://your-website.com/landing-website/ and this is their only point of using Canvas, then the jsFolder: "/js/" will not work as effectively. We have to take into consideration many use cases before releasing updates, yet it is not a 100% reliable solution for everyone.

  3. If you use:

<script src="js/plugins.min.js"></script>
<script src="js/functions.bundle.js"></script>

You don't need to edit the jsFolder or cssFolder Variables as they are not required in this scenario.

So, now you simply load either:

<script src="/js/plugins.min.js"></script>
<script src="/js/functions.bundle.js"></script>

or:

<script src="https://your-website.com/js/plugins.min.js"></script>
<script src="https://your-website.com/js/functions.bundle.js"></script>

That's it. No other changes.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard