# テーマコンポーネントにライブラリをロードする方法

**URL:** <https://meta.discourse.org/t/how-to-load-library-in-a-theme-component/276621>\
**Category:** Development\
**Created:** [2023 年 8 月 25 日午後 2:54 UTC](https://meta.discourse.org/t/how-to-load-library-in-a-theme-component/276621 "2023-08-25T14:54:17Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2023 年 8 月 25 日午後 3:05 UTC](https://meta.discourse.org/t/how-to-load-library-in-a-theme-component/276621/4 "2023-08-25T15:05:54Z")

</div>

どうもありがとうございます！

でも、それをやったと思ったのですが：

```plaintext
    return loadScript(settings.theme_uploads.QRCode).then(() => {
      return loadScript(settings.theme_uploads.QRCode);
    });

```

あなたの例をできるだけ少なく変更しようとしました 🙂

後でコードを使用しようとするときに `.then` を使用する必要があるのでしょうか？

しかし、それはCSPの問題を解決しませんよね？

![image](https://global.discourse-cdn.com/meta/original/4X/4/a/d/4adee628014aeef20a6560f2e696bf147104715e.png)

---

_[View the full topic](https://meta.discourse.org/t/how-to-load-library-in-a-theme-component/276621)._
