# 商品追加ボタンや新規住所の追加ボタンが動作しない

**URL:** <https://community.shopify.com/t/topic/33738>\
**Category:** 技術的なQ＆A\
**Created:** [January 28, 2021, 1:48pm UTC](https://community.shopify.com/t/topic/33738 "2021-01-28T13:48:51Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

Debutテーマをカスタマイズした際、商品追加ボタンやマイページの住所追加ボタンが反応せず、商品追加では読み込みアイコンが回り続ける不具合が発生。コンソールには `Cannot read property 'querySelectorAll' of null` というJavaScriptエラーが出ており、`theme.js` 内で必要なHTML要素を取得できていない状態が示されていました。

回答では、エラー情報だけでは特定が難しく、URLや実際の構造確認が必要との指摘がありました。あわせて、Debutの `theme.js` とHTML構造の不整合、またはテーマファイル自体の変更が原因候補として挙げられ、元のDebutテーマへ戻して確認する案も提示されました。

最終的に、元々Debutテーマにあったheader部分を置き換えたことが原因だと判明。headerのカスタマイズにより、`theme.js` が前提とする要素構造が欠け、関連機能が動作しなくなっていた形で、原因は特定済みです。

<div class="post-metadata">

**Author:** ![Anonymous\_b76cb432da02d13e307b1bc410425ff9](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@Anonymous\_b76cb432da02d13e307b1bc410425ff9](https://community.shopify.com/u/Anonymous_b76cb432da02d13e307b1bc410425ff9)\
**Post date:** [January 28, 2021, 1:48pm UTC](https://community.shopify.com/t/topic/33738/1 "2021-01-28T13:48:51Z")

</div>

Debutのテーマをカスタマイズして現在サイトを構築しているのですが、商品追加のボタンや、マイページから住所を追加するボタンをクリックしてもページ遷移しません。

※商品追加ボタンはクリックするとぐるぐる回るアイコンがずっと表示されたまま動きません。

一応調べてみたところ下記のエラーが吐き出されているのはわかったのですが、具体的にどのように修正すればいいのかがわかりません。

ーーーーーーーーーーーーーーーーーー

Uncaught TypeError: Cannot read property ‘querySelectorAll’ of null  
at cacheSelectors (theme.js?v=9300526583029825873:2901)  
at Object.init (theme.js?v=9300526583029825873:2867)  
at new Header (theme.js?v=9300526583029825873:7719)  
at Sections.\_createInstance (theme.js?v=9300526583029825873:47)  
at Sections. (theme.js?v=9300526583029825873:141)  
at NodeList.forEach ()  
at Sections.register (theme.js?v=9300526583029825873:139)  
at HTMLDocument. (theme.js?v=9300526583029825873:9571)  
cacheSelectors @ theme.js?v=9300526583029825873:2901  
init @ theme.js?v=9300526583029825873:2867  
Header @ theme.js?v=9300526583029825873:7719  
\_createInstance @ theme.js?v=9300526583029825873:47  
(anonymous) @ theme.js?v=9300526583029825873:141  
register @ theme.js?v=9300526583029825873:139  
(anonymous) @ theme.js?v=9300526583029825873:9571

ーーーーーーーーーーーーーーーーーー

どなたかわかる方いましたらご教示いただけますと幸いです。

---

<div class="post-metadata">

**Author:** ![Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/anonymous_44fbe07fc59d9ccaacd70575fd5a5155/32/194200_2.png) [@Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://community.shopify.com/u/Anonymous_44fbe07fc59d9ccaacd70575fd5a5155)\
**Post date:** [February 3, 2021, 4:00am UTC](https://community.shopify.com/t/topic/33738/2 "2021-02-03T04:00:08Z")

</div>

該当エラーは何かを特定する情報が含まれていないので、URLで示すなどでないと

解決は出来ないと思います。

---

<div class="post-metadata">

**Author:** ![\_osamu\_iwasaki](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/_osamu_iwasaki/32/272617_2.png) [@\_osamu\_iwasaki](https://community.shopify.com/u/_osamu_iwasaki)\
**Post date:** [February 3, 2021, 4:21am UTC](https://community.shopify.com/t/topic/33738/3 "2021-02-03T04:21:21Z")

</div>

debutテーマのtheme.jsの中身が変わっているか、theme.jsで使ってた定義がhtmlの構造の中に無いか、色々原因は考えられます。

エラー内容と構造を見比べてコードを修正するか、一度最初のdebutテーマから置き直してみるのがいいと思います。

---

<div class="post-metadata">

**Author:** ![Anonymous\_b76cb432da02d13e307b1bc410425ff9](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@Anonymous\_b76cb432da02d13e307b1bc410425ff9](https://community.shopify.com/u/Anonymous_b76cb432da02d13e307b1bc410425ff9)\
**Post date:** [February 3, 2021, 4:55am UTC](https://community.shopify.com/t/topic/33738/4 "2021-02-03T04:55:06Z")

</div>

ありがとうございます。

元々Debutテーマ内にあったheader部分を置き換えたのが原因だったようです。
