Skip to content

Commit

Permalink
fix(dev-server): fix Failed to open stack frame in editor error (#441)
Browse files Browse the repository at this point in the history
* fix(dev-server): fix open-stack-frame destructuring file info error
  • Loading branch information
hexboy authored Oct 10, 2023
1 parent 8a68670 commit a66785d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-bananas-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack-dev-server": patch
---

fix(dev-server): fix Failed to open stack frame in editor error
6 changes: 4 additions & 2 deletions packages/dev-server/src/plugins/devtools/devtoolsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ async function devtoolsPlugin(
url: '/open-stack-frame',
handler: async (request, reply) => {
try {
const { file, lineNumber, column } = JSON.parse(
request.body as string
const { file, lineNumber, column } = (
typeof request.body === 'string'
? JSON.parse(request.body)
: request.body
) as {
file: string;
lineNumber: number;
Expand Down

0 comments on commit a66785d

Please sign in to comment.