Repository: TypeScript
Issue: refactor: New file generates import from wrong module specifier
Labels: Bug,Crash

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
Version: 1.90.0 (user setup)
Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
Date: 2024-06-04T19:33:54.889Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

Steps to Reproduce:
```js
import prisma from "@/prisma/client";
import { NextRequest, NextResponse } from "next/server";
import { z } from "zod";

const createIssueSchema = z.object({
  title: z.string().min(1).max(255),
  description: z.string().min(1),
});
```
Try refactoring createIssueSchema variable to a new file
``
2024-06-12 09:20:14.898 [error] <semantic> TypeScript Server Error (5.5.0-dev.20240505)
Debug Failure.
Error: Debug Failure.
    at Object.addImportFromExportedSymbol (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:154711:32)
    at c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144661:19
    at Map.forEach (<anonymous>)
    at addTargetFileImports (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144655:17)
    at getNewStatementsAndRemoveFromOldFile (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:143871:3)
    at doChange4 (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144853:3)
    at c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144842:77
    at _ChangeTracker.with (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:174963:5)
    at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144842:60)
    at Object.getEditsForRefactor (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:142944:31)
    at Object.getEditsForRefactor2 [as getEditsForRefactor] (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:150350:32)
    at IpcIOSession.getEditsForRefactor (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:191692:49)
    at getEditsForRefactor (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:189914:43)
    at c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192078:69
    at IpcIOSession.executeWithRequestId (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192070:14)
    at IpcIOSession.executeCommand (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192078:29)
    at IpcIOSession.onMessage (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192120:51)
    at process.<anonymous> (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\tsserver.js:528:14)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:951:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21): Error: <semantic> TypeScript Server Error (5.5.0-dev.20240505)
Debug Failure.
Error: Debug Failure.
    at Object.addImportFromExportedSymbol (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:154711:32)
    at c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144661:19
    at Map.forEach (<anonymous>)
    at addTargetFileImports (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144655:17)
    at getNewStatementsAndRemoveFromOldFile (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:143871:3)
    at doChange4 (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144853:3)
    at c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144842:77
    at _ChangeTracker.with (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:174963:5)
    at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:144842:60)
    at Object.getEditsForRefactor (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:142944:31)
    at Object.getEditsForRefactor2 [as getEditsForRefactor] (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:150350:32)
    at IpcIOSession.getEditsForRefactor (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:191692:49)
    at getEditsForRefactor (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:189914:43)
    at c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192078:69
    at IpcIOSession.executeWithRequestId (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192070:14)
    at IpcIOSession.executeCommand (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192078:29)
    at IpcIOSession.onMessage (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\typescript.js:192120:51)
    at process.<anonymous> (c:\Users\ASUS\.vscode\extensions\ms-vscode.vscode-typescript-next-5.5.20240505\node_modules\typescript\lib\tsserver.js:528:14)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:951:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
	at n.create (c:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:473136)
	at v.dispatchResponse (c:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:467106)
	at v.dispatchMessage (c:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:465950)
	at ChildProcess.<anonymous> (c:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:1:465443)
	at ChildProcess.emit (node:events:514:28)
	at emit (node:internal/child_process:951:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
``
tsc version : 5.4.5