Skip to content

Support for custom paths in tsconfig.json #493

Open
@larsblumberg

Description

@larsblumberg

Problem

When configuring tsconfig.json with paths:

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": [
      "@fancyModules/*": ["./src/modules/fancyModule/*"]
    ]
  } 
}

the transpiler/loader used by threads wouldn't resolve these imports:

import { Thing } from "@fanceModules/things"

and thus lead to "module not found" errors.

Although this works perfectly when running the same code with ts-node / tsx.

Workaround

Do not use custom paths imports in any module that are directly or indirectly imported by a worker. Instead use relative imports for workers.

Related documentation

Possible support for threads?

Is there any change to get support for paths into threads?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions