[GH-ISSUE #268] Code generation for Fetch request type of some methods (POST, PUT, PATCH) won't be shown #93

Closed
opened 2026-03-16 13:21:17 +03:00 by kerem · 11 comments
Owner

Originally created by @reefqi037 on GitHub (Nov 6, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/268

Describe the bug
When you try to generate fetch request type code for POST or PUT or PATCH method, the code won't be generated and TypeError log can be seen in the console log. Once the error happened, you won't be able to generate code for other methods too.

To Reproduce
Steps to reproduce the behavior:

  1. Set Request Method to POST
  2. Click on Show Code button
  3. Select Fetch from the Request Type dropdowns
  4. See error in console log

Expected behavior
Code is generated and shown in the Generated Code section

Screenshots
TypeError

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise
  • Browser: Chrome
  • Version: 78.0.3904.87 (Official Build) (64-bit)
Originally created by @reefqi037 on GitHub (Nov 6, 2019). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/268 **Describe the bug** When you try to generate fetch request type code for POST or PUT or PATCH method, the code won't be generated and TypeError log can be seen in the console log. Once the error happened, you won't be able to generate code for other methods too. **To Reproduce** Steps to reproduce the behavior: 1. Set ```Request Method``` to ```POST``` 2. Click on ```Show Code``` button 3. Select ```Fetch``` from the ```Request Type``` dropdowns 4. See error in console log **Expected behavior** Code is generated and shown in the ```Generated Code``` section **Screenshots** ![TypeError](https://user-images.githubusercontent.com/44827833/68260687-10bfae00-0081-11ea-8663-395874f61d78.PNG) **Desktop (please complete the following information):** - OS: Windows 10 Enterprise - Browser: Chrome - Version: 78.0.3904.87 (Official Build) (64-bit)
kerem 2026-03-16 13:21:17 +03:00
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

Wow! That's a critical bug.. not sure how this happened. Will investigate it ASAP. Thanks for pointing it out.

<!-- gh-comment-id:550102942 --> @liyasthomas commented on GitHub (Nov 6, 2019): Wow! That's a critical bug.. not sure how this happened. Will investigate it ASAP. Thanks for pointing it out.
Author
Owner

@reefqi037 commented on GitHub (Nov 6, 2019):

Yeah I've realized it from last week. Just haven't got time to verify and post it.

<!-- gh-comment-id:550103728 --> @reefqi037 commented on GitHub (Nov 6, 2019): Yeah I've realized it from last week. Just haven't got time to verify and post it.
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

Any idea what went wrong?

<!-- gh-comment-id:550103894 --> @liyasthomas commented on GitHub (Nov 6, 2019): Any idea what went wrong?
Author
Owner

@reefqi037 commented on GitHub (Nov 6, 2019):

Sorry haven't look into the details yet.

<!-- gh-comment-id:550104439 --> @reefqi037 commented on GitHub (Nov 6, 2019): Sorry haven't look into the details yet.
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

Okay

<!-- gh-comment-id:550104512 --> @liyasthomas commented on GitHub (Nov 6, 2019): Okay
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

github.com/liyasthomas/postwoman@d290b25f8a solves this. Please verify bug fix. Actually this might break some users who already faced this issue causing the store to save the wrong state into vuex.
For them, clearing cookies will fix the issue. Please let me know if there's any trouble.

<!-- gh-comment-id:550122856 --> @liyasthomas commented on GitHub (Nov 6, 2019): https://github.com/liyasthomas/postwoman/commit/d290b25f8a0ed65b021b4686315c55614dd77584 solves this. Please verify bug fix. Actually this might break some users who already faced this issue causing the store to save the wrong state into vuex. For them, clearing cookies will fix the issue. Please let me know if there's any trouble.
Author
Owner

@reefqi037 commented on GitHub (Nov 6, 2019):

Nope. I've cleared site data and perform hard reset but the issue still persist.

<!-- gh-comment-id:550126972 --> @reefqi037 commented on GitHub (Nov 6, 2019): Nope. I've cleared site data and perform hard reset but the issue still persist.
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

Yeah! Working on it.

<!-- gh-comment-id:550127110 --> @liyasthomas commented on GitHub (Nov 6, 2019): Yeah! Working on it.
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

5e424bb64d mind giving a try once more to check if the issue persist?

<!-- gh-comment-id:550132924 --> @liyasthomas commented on GitHub (Nov 6, 2019): 5e424bb64d3af2dc15a050171438af57b6fbe24e mind giving a try once more to check if the issue persist?
Author
Owner

@reefqi037 commented on GitHub (Nov 6, 2019):

Yup. This should fix the issue. Wondered if it's okay to remove the $this.store.commit part.

<!-- gh-comment-id:550135030 --> @reefqi037 commented on GitHub (Nov 6, 2019): Yup. This should fix the issue. Wondered if it's okay to remove the ```$this.store.commit``` part.
Author
Owner

@liyasthomas commented on GitHub (Nov 6, 2019):

Good.
Committing request Code to vuex was a foolish thing to do.

<!-- gh-comment-id:550135297 --> @liyasthomas commented on GitHub (Nov 6, 2019): Good. Committing request Code to vuex was a foolish thing to do.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#93
No description provided.