When you use lightning/platformResourceLoader in Lightning web components (LWC) to access static resources and Lightning Web Security (LWS) is enabled, it’s possible that some APIs in those static resources exhibit inconsistent behavior among various browsers.
When Lightning Web Security (LWS) is enabled, JavaScript async functions loaded from a static resource currently work as expected in Chromium-based browsers, but may not function correctly in Firefox.
This is not considered as a bug. Rather, it is related to differences in browser behavior and how individual browsers implement certain JavaScript capabilities. The current LWS behavior aligns with the supported industry implementation and is not expected to change specifically for this scenario.
As a workaround, the JavaScript code in the static resource can be pre-compiled/transcompiled so that the async functions are converted into equivalent syntax that is compatible across the affected browsers.
This Babel plugin is recommended if you’re having issues with async functions in static resources: https://babeljs.io/docs/en/babel-plugin-transform-async-to-generator
Alternatively, you can refactor to use another approach, such as JavaScript promises.
ltng:require or lightning/platformResourceLoader to load the script.005465166

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.