Loading
Slack製品の問い合わせ先はSalesforce Helpへ統合・変更されます続きを読む

Change to Static Resources with async Functions Behave Inconsistently in Firefox and Safari

公開日: Oct 27, 2026
説明

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.

解決策
  1. Turn off LWS
  2. Transcompile async-await syntax with Babel and then use ltng:require or lightning/platformResourceLoader to load the script.
ナレッジ記事番号

005465166

 
読み込み中
Salesforce Help | Article