rest.js icon indicating copy to clipboard operation
rest.js copied to clipboard

[DOCS]: errors in the console, search doesn't work

Open dimaqq opened this issue 1 year ago • 15 comments

Describe the need

I'm unable to use search at https://octokit.github.io/rest.js/v20

There are also following errors in the console:

Screenshot 2024-05-23 at 13 50 13

production-app.js:283 TypeError: x is not a function
    at n.render (endpoint.js:44:10)
    at Ho (react-dom.production.min.js:187:188)
    at $o (react-dom.production.min.js:186:173)
    at Ku (react-dom.production.min.js:269:427)
    at Li (react-dom.production.min.js:250:347)
    at Ni (react-dom.production.min.js:250:278)
    at Pi (react-dom.production.min.js:250:138)
    at bi (react-dom.production.min.js:243:163)
    at hi (react-dom.production.min.js:237:175)
    at Ji (react-dom.production.min.js:285:27)

SDK Version

v20

API Version

No response

Relevant log output

production-app.js:283 TypeError: x is not a function
    at n.render (endpoint.js:44:10)
    at Ho (react-dom.production.min.js:187:188)
    at $o (react-dom.production.min.js:186:173)
    at Ku (react-dom.production.min.js:269:427)
    at Li (react-dom.production.min.js:250:347)
    at Ni (react-dom.production.min.js:250:278)
    at Pi (react-dom.production.min.js:250:138)
    at bi (react-dom.production.min.js:243:163)
    at hi (react-dom.production.min.js:237:175)
    at Ji (react-dom.production.min.js:285:27)

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

dimaqq avatar May 23 '24 04:05 dimaqq

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

github-actions[bot] avatar May 23 '24 04:05 github-actions[bot]

@dimaqq kindly assign this issue to me.

hunxjunedo avatar May 23 '24 07:05 hunxjunedo

All yours @hunxjunedo 👍 Thanks for looking into it

gr2m avatar May 23 '24 07:05 gr2m

it's weird that the search is working absolutely fine on my system, however I noticed a small difference, the live version doesn't show the favicon, while the local one does. Will take some time identifying the problem

EDIT: I looked into it, when it is served with HMR its fine, but when I build and then serve it, it shows the same error. prolly some issue with the plugins.

THE ISSUE: it's related to how Gatsby performs hydration and re-rendering in production mode: https://github.com/gatsbyjs/gatsby/discussions/17914

EDIT: after trying almost everything, it's still not working. the main issue is that it's allowing to change the state, whether it be through useState or react Contexts. This is explained by the fact the the menu toggle icon has been disabled as well, I assume some other dev had looked into that and just disabled the option.

hunxjunedo avatar May 23 '24 09:05 hunxjunedo

I'm pretty sure an issue of this type is not new in this repo, the disabled menu button despite the complete functionality in code clearly shows that it was once written to work, but was disabled due to the exact same problem with Gatsby. Now we have to decide the severity of this issue: do we need to migrate from Gatsby or just leave it as it is.

hunxjunedo avatar May 23 '24 15:05 hunxjunedo

I assume that problem existed for a long while. And @octokit/rest is an Octokit SDK variant that exists for legacy reasons. We recommend to use https://github.com/octokit/octokit.js instead. All this to say, this is not urgent. I also think that Gatsby is overkill for this documentation page

gr2m avatar May 23 '24 15:05 gr2m

Will be happy contribute to the new docs, just lemme know when you guys are looking to do it, this can be done in really simpler way other than Gatsby. Today was real hectic.

hunxjunedo avatar May 23 '24 16:05 hunxjunedo

Feel free to contribute to a new docs page. There isn't a set timeline

wolfy1339 avatar May 23 '24 16:05 wolfy1339

Alr, will look into it in the near future.

hunxjunedo avatar May 23 '24 16:05 hunxjunedo

I assume that problem existed for a long while. And @octokit/rest is an Octokit SDK variant that exists for legacy reasons. We recommend to use https://github.com/octokit/octokit.js instead. All this to say, this is not urgent. I also think that Gatsby is overkill for this documentation page

I'd like to make a counterpoint to this. I forked a project that was using this instead of the newer version you linked. Unfortunately, I am unable to search in the documentation to make sure I understand what they were trying to accomplish before hastily attempting to rewrite it. The documentation of an obsolete project is perhaps the most important thing to leave in a working state.

TypeError: x is not a function
    render endpoint.js:44
    React 13
    v production-app.js:283
    5824 production-app.js:294
react-dom.production.min.js:216:199
    React 5
    unstable_runWithPriority scheduler.production.min.js:18
    React 9
    v production-app.js:283
    5824 production-app.js:294
TypeError: x is not a function
    render endpoint.js:44
    React 13
    v production-app.js:283
    5824 production-app.js:294
react-dom.production.min.js:216:199
    React 5
    unstable_runWithPriority scheduler.production.min.js:18
    React 4
    unstable_runWithPriority scheduler.production.min.js:18
    React 6
    v production-app.js:283
    5824 production-app.js:294
Uncaught TypeError: x is not a function
    render endpoint.js:44
    React 13
    v production-app.js:283
    5824 production-app.js:294
endpoint.js:44:9
    render endpoint.js:44
    React 13
    v production-app.js:283
    5824 production-app.js:294

AbandonedCart avatar May 26 '24 10:05 AbandonedCart

Yeah it has been understood and acknowledged, and I intend to release a functional and better version of the docs soon Inshallah.

hunxjunedo avatar May 26 '24 10:05 hunxjunedo

I'd like to make a counterpoint to this. I forked a project that was using this instead of the newer version you linked.

@octokit/rest is still being updated, and the same endpoints are available in octokit. The only difference is that the endpoints methods are prefixed with rest. in the octokit package, while here they are available both unprefixed and prefixed.

If you only need the REST endpoints, then this is much more minimal then octokit.

wolfy1339 avatar May 26 '24 20:05 wolfy1339

@octokit/rest is still being updated, and the same endpoints are available in octokit. The only difference is that the endpoints methods are prefixed with rest. in the octokit package, while here they are available both unprefixed and prefixed.

If you only need the REST endpoints, then this is much more minimal then octokit.

Unfortunately, what I needed to know were details about code that already made that decision. I found my answers, but the time invested deterred investing more time to convert it, as well. In the end, we dropped the library in favor of a more direct approach.

AbandonedCart avatar May 26 '24 22:05 AbandonedCart

@hunxjunedo Have you made any progress on this issue?

wolfy1339 avatar Aug 15 '24 23:08 wolfy1339

Not yet, really busy nowadays, will prolly do it this month.

hunxjunedo avatar Aug 16 '24 07:08 hunxjunedo