diff --git a/src/debugger/appWorker.ts b/src/debugger/appWorker.ts index 94f512426..83a473b83 100644 --- a/src/debugger/appWorker.ts +++ b/src/debugger/appWorker.ts @@ -63,7 +63,8 @@ Object.defineProperty(process, "versions", { value: undefined }); -// TODO: Replace by url.fileURLToPath method when Node 10 LTS become deprecated +// Polyfill for url.fileURLToPath - needed because this code runs in user's RN environment +// where we cannot use import/require. Keep this implementation. function fileUrlToPath(url) { if (process.platform === 'win32') { return url.toString().replace('file:///', ''); diff --git a/src/debugger/forkedAppWorker.ts b/src/debugger/forkedAppWorker.ts index e760e2d94..691599e15 100644 --- a/src/debugger/forkedAppWorker.ts +++ b/src/debugger/forkedAppWorker.ts @@ -203,7 +203,8 @@ export class ForkedAppWorker implements IDebuggeeWorker { return promise; } - // TODO: Replace by url.pathToFileURL method when Node 10 LTS become deprecated + // Simple and reliable implementation for converting file path to file:// URL + // Keep this instead of using url.pathToFileURL() to avoid URL encoding issues public pathToFileUrl(url: string): string { const filePrefix = process.platform === "win32" ? "file:///" : "file://"; return filePrefix + url;