fix: code generate modal erroring out #4033
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofhttpsnippet
(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 thathttpsnippet
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 inpnpm
v8,pnpm
resolved it properly to load the version asked in peer dependencies, but this behaviour changed in v9. The fix here just addsajv
of the requested version added as a dependency to the users ofhttpsnippet
so thatpnpm
resolves it correctly.Checks
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.