teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

スクショを編集

2022/11/12 04:28

投稿

takoyan
takoyan

スコア105

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,7 @@
1
1
  ### 前提
2
2
  現在ポートフォリオを作成しています。
3
+ この質問は複数サイトに投稿しています。
4
+ 回答が得られた場合は、回答されてない投稿を削除します。
3
5
 
4
6
  URL
5
7
  https://manga-kousatu-net.vercel.app/
@@ -23,16 +25,30 @@
23
25
 
24
26
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-11-02/fcbf92bc-c744-4ab9-97fe-2ad3c98fce21.png)
25
27
 
26
- ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-11-02/2efd941c-70aa-4c36-90e3-c34b4cbb8593.png)
27
28
 
28
29
  ### 発生している問題・エラーメッセージ
29
30
 
30
31
  ```
31
32
  Unhandled Runtime Error
32
- Error: Hydration failed because the initial UI does not match what was rendered on the server.
33
+ TypeError: Cannot read properties of undefined (reading 'indexOf')
34
+
35
+ Source
36
+ pages/post/[id].jsx (65:21) @ _callee$
37
+
38
+ 63 | const getData = async () => {
39
+ 64 | //firestoreからデータ取得
40
+ > 65 | const data = doc(database, "posts", id);
41
+ | ^
42
+ 66 | console.log("Error getting document:", id);
43
+ 67 | getDoc(data)
44
+ 68 | .then((documentSnapshot) => {
45
+ Call Stack
46
+ eval
47
+ pages/post/[id].jsx (151:4)
48
+ Show collapsed frames
33
49
  ```
50
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-11-12/afb4c579-2bab-428a-83d5-a201c275ed76.png)
34
51
 
35
-
36
52
  ```JavaScript
37
53
  /post/[id].jsx
38
54
  import系
@@ -119,9 +135,6 @@
119
135
  usersData();
120
136
  }, [likes]);
121
137
 
122
- // getData();
123
- // usersData();
124
-
125
138
  const updatefields = () => {
126
139
  更新処理
127
140
  }