Skip to content

Relative import is not resolved if module name starts with dot #976

Description

When we import a module starting with . (dot), I am gettubg MODULE_NOT_FOUND error.

.
├── app
│  ├── .generated
│  │  ├── client.ts
│  │  └── index.ts
│  ├── generated
│  │  ├── client.ts
│  │  └── index.ts
│  ├── dotted.ts
│  └── simple.ts
├── scripts
│  ├── test-dotted.ts
│  └── test-simple.ts
├── package.json
├── pnpm-lock.yaml
└── tsconfig.json

We have a tool that generates client code under .generated module. If we remove the . from the module name, it works fine.

swc-node-issue.zip

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