Skip to content

Possibly incorrect module resolution? #54

@jasonkuhrt

Description

@jasonkuhrt

In a Vitepress project I am seeing the following behaviour.

Given a code block like:

CleanShot 2024-09-06 at 18 08 57@2x

And given this file system in current working directory:

node_modules/
  bar/
    index.d.ts (contains: export declare const foo: number)
bar/
  index.d.ts (contains: export declare const foo2: number)

Then twoslash attempts to resolve the bar import to from ./bar instead of ./node_modules/bar.

CleanShot 2024-09-06 at 18 11 08@2x

If I rm -rf bar then node_modules/bar is used.

I think it might be an error that an import for bar would pick up ./bar before first looking for node_modules/bar.

When I run this in GitHub Actions, this problem does not happen. I am not sure why yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions