Skip to content

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

Closed
@mikerudge

Description

@mikerudge

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

Activity

mustafa-hanif

mustafa-hanif commented on May 26, 2025

@mustafa-hanif

+1 this is a major problem in nextjs

jakebailey

jakebailey commented on May 27, 2025

@jakebailey
Member

Do you have a repo we could test?

jakebailey

jakebailey commented on May 28, 2025

@jakebailey
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jakebailey@mikerudge@mustafa-hanif

      Issue actions

        Paths with parenthesis cause the vscode extension to not understand import parths · Issue #932 · microsoft/typescript-go