typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Paths with parenthesis cause the vscode extension to not understand import parths

Open mikerudge opened this issue 7 months ago • 2 comments

if I have this import

import { Button } from '@/components/ui/button'

Then it works fine in the file 'app/page.tsx' app/hello/page.tsx etc

However, if I have app/(test)/test/page.tsx

I get an error "Cannot find module"

Here is screenshot. Image

@typescript/native-preview: "7.0.0-dev.20250523.1",
Ext Version: 0.20250523.1

mikerudge avatar May 24 '25 14:05 mikerudge

+1 this is a major problem in nextjs

mustafa-hanif avatar May 26 '25 10:05 mustafa-hanif

Do you have a repo we could test?

jakebailey avatar May 27 '25 23:05 jakebailey

Here you go @jakebailey

https://github.com/mikerudge/tsgo-error-example

mikerudge avatar May 28 '25 09:05 mikerudge

Thanks. The issue here is that in the editor, the file is not being considered part of the project, so is instead being treated as an "inferred" file without a tsconfig.

Info 19   [10:46:18.440] Open files: 
Info 19   [10:46:18.440] 	FileName: /home/jabaile/tsgo932/app/hello/page.tsx ProjectRootPath: 
Info 19   [10:46:18.440] 		Projects: /home/jabaile/tsgo932/tsconfig.json
Info 19   [10:46:18.440] 	FileName: /home/jabaile/tsgo932/app/%28test%29/comp/comp-test.tsx ProjectRootPath: 
Info 19   [10:46:18.440] 		Projects: /dev/null/inferredProject1*
Info 19   [10:46:18.440] Starting updateGraph: Project: /home/jabaile/tsgo932/tsconfig.json
Info 20   [10:46:18.440] Program 2 used 1 checker(s)

Which I suspect is due to us not unescaping the URI.

jakebailey avatar May 28 '25 17:05 jakebailey