swc-node icon indicating copy to clipboard operation
swc-node copied to clipboard

Relative import is not resolved if module name starts with dot

Open cristatus opened this issue 3 months ago • 1 comments

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

cristatus avatar Oct 28 '25 10:10 cristatus

May be related to https://github.com/swc-project/swc/issues/9551

cristatus avatar Oct 28 '25 11:10 cristatus