Skip to content

Move to File and Move to new File not working to React components #62029

Open
@xmonkee

Description

@xmonkee

Type: Bug

ERR TypeScript Server Error (5.8.2)
Debug Failure. False expression: Expected symbol to be a module
Error: Debug Failure. False expression: Expected symbol to be a module
at Object.addImportForModuleSymbol (/node_modules/typescript/lib/typescript.js:157416:11)
at /node_modules/typescript/lib/typescript.js:147140:19
at Map.forEach ()
at addTargetFileImports (/node_modules/typescript/lib/typescript.js:147133:17)
at getNewStatementsAndRemoveFromOldFile (/node_modules/typescript/lib/typescript.js:146364:3)
at doChange4 (/node_modules/typescript/lib/typescript.js:147360:3)
at /node_modules/typescript/lib/typescript.js:147349:77
at _ChangeTracker.with (/node_modules/typescript/lib/typescript.js:178070:5)
at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (/node_modules/typescript/lib/typescript.js:147349:60)
at Object.getEditsForRefactor (/node_modules/typescript/lib/typescript.js:145454:31)
at Object.getEditsForRefactor2 [as getEditsForRefactor] (/node_modules/typescript/lib/typescript.js:152954:32)
at IpcIOSession.getEditsForRefactor (/node_modules/typescript/lib/typescript.js:195255:49)
at getEditsForRefactor (/node_modules/typescript/lib/typescript.js:193406:43)
at /node_modules/typescript/lib/typescript.js:195676:15
at IpcIOSession.executeWithRequestId (/node_modules/typescript/lib/typescript.js:195665:14)
at IpcIOSession.executeCommand (/node_modules/typescript/lib/typescript.js:195674:29)
at IpcIOSession.onMessage (/node_modules/typescript/lib/typescript.js:195722:68)
at process. (/node_modules/typescript/lib/_tsserver.js:519:14)
at process.emit (node:events:524:28)
at emit (node:internal/child_process:950:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21): Error: TypeScript Server Error (5.8.2)
Debug Failure. False expression: Expected symbol to be a module
Error: Debug Failure. False expression: Expected symbol to be a module
at Object.addImportForModuleSymbol (/node_modules/typescript/lib/typescript.js:157416:11)
at /node_modules/typescript/lib/typescript.js:147140:19
at Map.forEach ()
at addTargetFileImports (/node_modules/typescript/lib/typescript.js:147133:17)
at getNewStatementsAndRemoveFromOldFile (/node_modules/typescript/lib/typescript.js:146364:3)
at doChange4 (/node_modules/typescript/lib/typescript.js:147360:3)
at /node_modules/typescript/lib/typescript.js:147349:77
at _ChangeTracker.with (/node_modules/typescript/lib/typescript.js:178070:5)
at Object.getRefactorEditsToMoveToNewFile [as getEditsForAction] (/node_modules/typescript/lib/typescript.js:147349:60)
at Object.getEditsForRefactor (/node_modules/typescript/lib/typescript.js:145454:31)
at Object.getEditsForRefactor2 [as getEditsForRefactor] (/node_modules/typescript/lib/typescript.js:152954:32)
at IpcIOSession.getEditsForRefactor (/node_modules/typescript/lib/typescript.js:195255:49)
at getEditsForRefactor (/node_modules/typescript/lib/typescript.js:193406:43)
at /node_modules/typescript/lib/typescript.js:195676:15
at IpcIOSession.executeWithRequestId (/node_modules/typescript/lib/typescript.js:195665:14)
at IpcIOSession.executeCommand (/node_modules/typescript/lib/typescript.js:195674:29)
at IpcIOSession.onMessage (/node_modules/typescript/lib/typescript.js:195722:68)
at process. (/node_modules/typescript/lib/_tsserver.js:519:14)
at process.emit (node:events:524:28)
at emit (node:internal/child_process:950:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
at Function.create (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:2:496515)
at y.dispatchResponse (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:2:490107)
at y.dispatchMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:2:488548)
at ChildProcess. (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:2:488041)
at ChildProcess.emit (node:events:524:28)
at ChildProcess.emit (node:domain:489:12)
at emit (node:internal/child_process:950:14)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

VS Code version: Code 1.100.2 (Universal) (848b80aeb52026648a8ff9f7c45a9b0a80641e2e, 2025-05-14T21:47:40.416Z)
OS version: Darwin arm64 24.1.0
Modes:

System Info
Item Value
CPUs Apple M3 (8 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 4, 4, 5
Memory (System) 16.00GB (0.05GB free)
Process Argv --crash-reporter-id cd448239-b3da-4fa9-9167-25e187c76b48
Screen Reader no
VM 0%
Extensions (25)
Extension Author (truncated) Version
claude-code Ant 0.2.122
vscode-tailwindcss bra 0.14.20
vscode-eslint dba 3.0.10
docker doc 0.7.0
gitlens eam 17.1.1
prettier-vscode esb 11.0.0
figma-vscode-extension fig 0.4.1
auto-rename-tag for 0.1.10
copilot Git 1.326.1596
copilot-chat Git 0.27.2
vscode-github-actions git 0.27.1
terraform has 2.34.4
batch-rename-extension Jan 0.0.6
rainbow-csv mec 3.19.0
vscode-containers ms- 2.0.2
vscode-docker ms- 2.0.0
remote-ssh ms- 0.120.0
remote-ssh-edit ms- 0.87.0
remote-explorer ms- 0.5.0
vsliveshare ms- 1.0.5948
docker-compose p1c 0.5.1
prisma Pri 6.8.2
explorer vit 1.17.1
vim vsc 1.30.1
glean wix 5.2.2

(2 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
pylancecolor:31314202
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004
j6a0c355:31309728

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions