Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Consulting index error #899

Closed
bradystroud opened this issue Jun 30, 2023 · 2 comments · Fixed by #898 or #926
Closed

🐛 Consulting index error #899

bradystroud opened this issue Jun 30, 2023 · 2 comments · Fixed by #898 or #926
Assignees
Labels
Type: Bug A problem with existing functionality

Comments

@bradystroud
Copy link
Member

bradystroud commented Jun 30, 2023

Describe the bug
When you load the consulting index page, there is an error.

To Reproduce

  1. Go to /consulting
image
@bradystroud bradystroud added the Type: Bug A problem with existing functionality label Jun 30, 2023
@bradystroud bradystroud changed the title 🐛 Consulting index 🐛 Consulting index error Jun 30, 2023
@bradystroud bradystroud linked a pull request Jul 3, 2023 that will close this issue
@bradystroud bradystroud assigned Harry-Ross and unassigned bradystroud Jul 3, 2023
@bradystroud
Copy link
Member Author

bradystroud commented Jul 3, 2023

As per my conversation with @Harry-Ross , this was fixed with #898

I think we should investigate further and see if we can answer these questions

  1. Why did it used to work?
  2. Was there a change that broke it?
  3. The issue is with the footer - why it was only failing on the consulting index page?
  4. Do we need to depend on DayJS

@Harry-Ross
Copy link
Contributor

Answer to Q1-3:
From my investigation, the reason why the /consulting route had a bug with .fromNow() function from the dayjs/plugin/relativeTime module, but not the other pages was because the UpcomingEvents component was imported by using the component, which contains dayjs.extend(relativeTime). This wasn't noticed as most of the pages have the component in the page, which therefore loaded UpcomingEvents and the DayJS module extension. I have fixed this by having a single source of truth in the root app file for which DayJS modules have been loaded, which should make it clear to both devs and the TypeScript compiler which modules are available for use in the project.

I found the desired configuration at iamkun/dayjs#1577. This means that by using dayjs.extend(), each subsequent use of DayJS will have the plugin used with the function.

  1. We do need DayJS, as it formats the relative time in words (i.e. 1 hour ago, 6 years ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug A problem with existing functionality
Projects
Archived in project
2 participants