# Static Resources with async Functions Behave Inconsistently

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 LWS is enabled, JavaScript `async` functions that are used from a static resource work in Chromium-based browsers, but don’t work in Firefox currently. The issue is a [bug in Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=1663090).

You can get around this issue in Firefox by pre-compiling the code that’s in the static resource so the `async` function is replaced by equivalent code.

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.

**See Also**

- [YouTube Video: Understanding Asynchronous JavaScript](https://www.youtube.com/watch?v=ytL4NXW_CGY)
