DiscoTOC מראה לי שגיאת סוג TypeError

It’s showing me below error. hot to fix it?

btw, after I add TOC in a topic, I need to refresh the page, otherwise the TOC link is not working. is this a normal behavior?

לייק 1

Hey @Yt.w, thanks for the report. I couldn’t reproduce the issue you mentioned. Do you still observe this behavior? If so, could you please provide more details on the steps to reproduce it?

From what I can see, refreshing the page to rebuild the HTML is expected behavior. While it might be possible to avoid this, it would require changes to how the component currently works.

לייק 1

Hello, I still observe this behavior, and it actually occurred immediately after I installed my current instance. I didn’t make any changes.

My other instance doesn’t have this issue, so it’s quite confusing for me.

From a UX perspective, I believe it’s better to avoid refreshing the page to keep the TOC active.

לייק 1

@Yt.w can you show me your browser console when you have this error please? Expand the error too.


Hello, this is what shows in my console

I have this exact same error on one of the three sites I am hosting in a multi-site set up which leads me to believe one of the settings I have in that site is making this happen. I have not yet determined which setting but when I track it down I will circle back and update the post, I just wanted to add that I am also seeing this in the wild on the latest tests-passed release.

This is what is in my console and it is all things I am used to seeing for better or worse :slight_smile:

לייק 1

thanks, we are still struggling with an exact repro, we are unable to make this happens on our multisite hosted sites.

לייק 1

This may or may not be a red herring, I haven’t had enough time to dig but when I remove and re-install the component I consistently get the following error:

image

The field number changes I presume because it is being installed as a different component number on every re-install of the component. I will continue to dig but this doesn’t happen when I do the same with any other components…

My current suspicions is that the failure is in part due to me backing out some S3 changes I made specifically on this site at some point. @Yt.w any chance you also used S3 at some point on your install?

2 לייקים

בסדר, הצלחתי לגרום לשגיאה להיעלם ושחזרתי אותה.

סיכום מהיר

  • חזרה להגדרות סיומת S3 שעבדו קודם והסרת ההתקנה והתקנת מרכיב DiscoTOC מובילים להתקנה ללא שגיאות של המרכיב.
  • השבתת S3 על ידי הערת כל ההוראות ב-app.yml מובילה להחזרת השגיאה כאשר המרכיב מותקן, ואני מניח שבעדכון השגיאה תחזור גם.
  • קביעת DISCOURSE_USE_S3: false לא מונעת מ-Discourse להשתמש בנתיבי S3, זה מרגיש כמו באג או שההגדרה הזאת לא עושה את מה שאני חושב שהיא עושה.

סקירה מפורטת

בהתחלה מה שעשיתי זה להחיות את ההגדרה שלי של minio, לבטל את ההגדרות ב-app.yml, לבנות את היישום, ולוודא להריץ את המשימה s3:upload_assets. כשהאתר חזר לפעול, ניגשתי לחלק של הרכיבים. הרכיב DiscoTOC שכבר הותקן עדיין הראה את השגיאה, אך כשמחקתי אותו והתקנתי מחדש, השגיאה לא הופיעה שוב. במהלך ההתקנה של רכיב DiscoTOC נבקשה הקובץ sprite.svg משרת ה-S3 שלי.

במהלך ניסיון לשחזור הבעיה נתקלתי בבעיה מעניינת. נראה שכאשר אני משאיר את כל ההוראות ב-app.yml פעילות, כלומר לא הערתי אותן, אבל מגדיר DISCOURSE_USE_S3: false, פני האתר לא ייטען אם שירות מיניו אינו רץ.

אולי DISCOURSE_USE_S3: False לא מיועד לשלול את כל הגישה ל-S3, אני מנחש שזה מתוך השם, אבל באופן ברור זה לא. ברגע שאני מחדש את שירות מיניו ומרענן את האתר, הכל עובד בסדר. אני גם מצליח להסיר ולשים מחדש את רכיב DiscoTOC מבלי לשחזר את השגיאה במצב הזה. נראה שזה לפחות באג.

זהו מצב שלישי שהוביל אותי לשחזור השגיאה:

כדי שהאתר שלי יעבוד בלי שרות מיניו פועל מחדש, הערתי את כל ההגדרות שיש להן קשר ל-S3 ב-config. לאחר שבניתי את היישום שוב, ולא רץ מיניו, הטעינה של האתר נעימה. אך אם אני מתקין מחדש את ה-DiscoTOC, השגיאה מופיעה שוב. ניסיתי גם להפעיל את מיניו במצב הזה, והשגיאה חזרה על עצמה בעת ההתקנה. כנראה בשל העובדה שלא היו הגדרות ל-S3 ב-app.yml, כך שגם אם המערכת סבירה לנסות להתחבר ל-S3 באופן אוטומטי, היא תעשה זאת עם ערכים ברירת מחדל שאינם מטעים.
למרות זאת, נראה כי חלק מהתמונות מנסים עדיין להישתף מ- S3 אפילו לאחר rebake של הפוסט (למשל 1531a70abda0d81d1a4039b6f3fa38bea79ef0de_2_180x180.png/xl.meta).

2 לייקים

כן, הפורום שהייתה בו בעיה השתמש ב-S3 (B2), בעוד שהפורום שלא היו בו בעיות לא השתמש ב-S3.

לייק 1