1

I am loading a JS file in a LWC with:

import { loadScript } from "lightning/platformResourceLoader";

connectedCallback() {
    loadScript(this, "/resource/simpleTest")
      .then(() => {
        console.log("file loaded");
      })
      .catch(e => {
        console.log("error: ", e);
      });
}

On Community I get: "Failed to load resource: the server responded with a status of 503 (Service Unavailable)" and when I click on the url on the right I arrive on a page saying that "https://my-domain.cs189.force.com/digital is closed for maintenance...". When testing outside Community it is working fine.

0

As mentioned here, I don't think lightning/platformResourceLoader is supported for communities yet (or at the least not fully supported).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.