[PR #4033] [MERGED] fix: code generate modal erroring out #4639

Closed
opened 2026-03-17 02:09:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4033
Author: @AndrewBastin
Created: 5/3/2024
Status: Merged
Merged: 5/6/2024
Merged by: @AndrewBastin

Base: release/2024.3.3Head: fix/codegen-break


📝 Commits (2)

  • 8d482de fix: wrong ajv version being loaded
  • 32dfb72 chore: change to patch ajv as a dependency instead of a peer

📊 Changes

2 files changed (+106 additions, -83 deletions)

View changed files

📝 package.json (+1 -1)
📝 pnpm-lock.yaml (+105 -82)

📄 Description

Closes #4008

This PR fixes the issue where the Generate Code Modal errors out when opened.

What's Changed

The issue is mostly caused by ajv a dependency of httpsnippet (the library we use to power the Generate Code feature) not being kept properly up-to-date by the source package and needs to be pinned to an older version. We had this going in an earlier fix, but our fix was not solid, we just declared that httpsnippet has a peer dependency that is set to a specific version that works. But since its a peer dependency we are expected to have it installed as well. For some reason in pnpm v8, pnpm resolved it properly to load the version asked in peer dependencies, but this behaviour changed in v9. The fix here just adds ajv of the requested version added as a dependency to the users of httpsnippet so that pnpm resolves it correctly.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Notes to reviewer

It is best to clear the node_modules and then running pnpm install before you spin up a dev server or a deploy instance as vite sometimes misses the changes.

# While cd-ed into the root of the repo
rm -rv node_modules packages/*/node_modules
pnpm install 

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4033 **Author:** [@AndrewBastin](https://github.com/AndrewBastin) **Created:** 5/3/2024 **Status:** ✅ Merged **Merged:** 5/6/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2024.3.3` ← **Head:** `fix/codegen-break` --- ### 📝 Commits (2) - [`8d482de`](https://github.com/hoppscotch/hoppscotch/commit/8d482decb9b66a046870bd5d60e15376f34e7a3b) fix: wrong ajv version being loaded - [`32dfb72`](https://github.com/hoppscotch/hoppscotch/commit/32dfb72b70f91a6ebda9bf1c7a721733fd2d3363) chore: change to patch ajv as a dependency instead of a peer ### 📊 Changes **2 files changed** (+106 additions, -83 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `pnpm-lock.yaml` (+105 -82) </details> ### 📄 Description Closes #4008 This PR fixes the issue where the Generate Code Modal errors out when opened. ### What's Changed The issue is mostly caused by `ajv` a dependency of `httpsnippet` (the library we use to power the Generate Code feature) not being kept properly up-to-date by the source package and needs to be pinned to an older version. We had this going in an earlier fix, but our fix was not solid, we just declared that `httpsnippet` has a peer dependency that is set to a specific version that works. But since its a peer dependency we are expected to have it installed as well. For some reason in `pnpm` v8, `pnpm` resolved it properly to load the version asked in peer dependencies, but this behaviour changed in v9. The fix here just adds `ajv` of the requested version added as a dependency to the users of `httpsnippet` so that `pnpm` resolves it correctly. ### Checks - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Notes to reviewer It is best to clear the node_modules and then running `pnpm install` before you spin up a dev server or a deploy instance as vite sometimes misses the changes. ```bash # While cd-ed into the root of the repo rm -rv node_modules packages/*/node_modules pnpm install ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:09:24 +03:00
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#4639
No description provided.